Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
hpvm-release
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
llvm
hpvm-release
Commits
c6ef1bc6
Commit
c6ef1bc6
authored
6 years ago
by
Hashim Sharif
Browse files
Options
Downloads
Patches
Plain Diff
Fixing bug in readLabels (utils)
parent
a39ad20d
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
llvm/test/VISC/DNN_Benchmarks/common/include/tensorUtils.h
+4
-4
4 additions, 4 deletions
llvm/test/VISC/DNN_Benchmarks/common/include/tensorUtils.h
with
4 additions
and
4 deletions
llvm/test/VISC/DNN_Benchmarks/common/include/tensorUtils.h
+
4
−
4
View file @
c6ef1bc6
...
@@ -209,7 +209,7 @@ void* readInputTensor(const char* file_name, int data_type, int dim1_size, int d
...
@@ -209,7 +209,7 @@ void* readInputTensor(const char* file_name, int data_type, int dim1_size, int d
dim3_size
,
dim4_size
);
dim3_size
,
dim4_size
);
initTensorData
(
input
,
tensor_data
,
size_in_bytes
);
initTensorData
(
input
,
tensor_data
,
size_in_bytes
);
compareValues
(
input
,
tensor_data
,
num_elems
);
//
compareValues(input, tensor_data, num_elems);
return
input
;
return
input
;
}
}
...
@@ -249,7 +249,7 @@ struct Tensor* readTrainedWeights(const char* file_name, int data_type, int dim1
...
@@ -249,7 +249,7 @@ struct Tensor* readTrainedWeights(const char* file_name, int data_type, int dim1
uint8_t
*
readLabels
(
const
char
*
labels_file
,
int
num_labels
){
uint8_t
*
readLabels
(
const
char
*
labels_file
,
int
num_labels
){
int
file_header_size
=
8
;
//
int file_header_size = 8;
uint8_t
*
labels
=
(
uint8_t
*
)
malloc
(
sizeof
(
uint8_t
)
*
num_labels
);
uint8_t
*
labels
=
(
uint8_t
*
)
malloc
(
sizeof
(
uint8_t
)
*
num_labels
);
FILE
*
file
=
fopen
(
labels_file
,
"rb"
);
FILE
*
file
=
fopen
(
labels_file
,
"rb"
);
if
(
file
==
NULL
){
if
(
file
==
NULL
){
...
@@ -257,9 +257,9 @@ uint8_t* readLabels(const char* labels_file, int num_labels){
...
@@ -257,9 +257,9 @@ uint8_t* readLabels(const char* labels_file, int num_labels){
abort
();
abort
();
}
}
fseek
(
file
,
file_header_size
,
SEEK_CUR
);
// Skipping the file header
//
fseek(file, file_header_size, SEEK_CUR); // Skipping the file header
size_t
bytes_read
=
fread
(
labels
,
1
,
sizeof
(
uint8_t
)
*
num_labels
,
file
);
size_t
bytes_read
=
fread
(
labels
,
1
,
sizeof
(
uint8_t
)
*
num_labels
,
file
);
printf
(
"
--l
abel
s
bytes_read = %zu
\n
"
,
bytes_read
);
printf
(
"
*L
abel bytes_read = %zu
\n
"
,
bytes_read
);
return
labels
;
return
labels
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment