Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
gaoqiong
MIGraphX
Commits
0c6195ee
Commit
0c6195ee
authored
Jun 06, 2019
by
Paul
Browse files
Rename file type variable
parent
c5a7bf90
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
+9
-9
src/driver/main.cpp
src/driver/main.cpp
+9
-9
No files found.
src/driver/main.cpp
View file @
0c6195ee
...
@@ -14,15 +14,15 @@ inline namespace MIGRAPHX_INLINE_NS {
...
@@ -14,15 +14,15 @@ inline namespace MIGRAPHX_INLINE_NS {
struct
loader
struct
loader
{
{
std
::
string
file
;
std
::
string
file
;
std
::
string
type
;
std
::
string
file_
type
;
bool
is_nhwc
=
true
;
bool
is_nhwc
=
true
;
unsigned
trim
=
0
;
unsigned
trim
=
0
;
void
parse
(
argument_parser
&
ap
)
void
parse
(
argument_parser
&
ap
)
{
{
ap
(
file
,
{},
ap
.
metavar
(
"<input file>"
));
ap
(
file
,
{},
ap
.
metavar
(
"<input file>"
));
ap
(
type
,
{
"--onnx"
},
ap
.
help
(
"Load as onnx"
),
ap
.
set_value
(
"onnx"
));
ap
(
file_
type
,
{
"--onnx"
},
ap
.
help
(
"Load as onnx"
),
ap
.
set_value
(
"onnx"
));
ap
(
type
,
{
"--tf"
},
ap
.
help
(
"Load as tensorflow"
),
ap
.
set_value
(
"tf"
));
ap
(
file_
type
,
{
"--tf"
},
ap
.
help
(
"Load as tensorflow"
),
ap
.
set_value
(
"tf"
));
ap
(
is_nhwc
,
{
"--nhwc"
},
ap
.
help
(
"Treat tensorflow format as nhwc"
),
ap
.
set_value
(
true
));
ap
(
is_nhwc
,
{
"--nhwc"
},
ap
.
help
(
"Treat tensorflow format as nhwc"
),
ap
.
set_value
(
true
));
ap
(
is_nhwc
,
{
"--nchw"
},
ap
.
help
(
"Treat tensorflow format as nchw"
),
ap
.
set_value
(
false
));
ap
(
is_nhwc
,
{
"--nchw"
},
ap
.
help
(
"Treat tensorflow format as nchw"
),
ap
.
set_value
(
false
));
ap
(
trim
,
{
"--trim"
,
"-t"
},
ap
.
help
(
"Trim instructions from the end"
));
ap
(
trim
,
{
"--trim"
,
"-t"
},
ap
.
help
(
"Trim instructions from the end"
));
...
@@ -31,17 +31,17 @@ struct loader
...
@@ -31,17 +31,17 @@ struct loader
program
load
()
program
load
()
{
{
program
p
;
program
p
;
if
(
type
.
empty
())
if
(
file_
type
.
empty
())
{
{
if
(
ends_with
(
file
,
".onnx"
))
if
(
ends_with
(
file
,
".onnx"
))
type
=
"onnx"
;
file_
type
=
"onnx"
;
else
(
ends_with
(
file
,
".pb"
))
else
type
=
"tf"
;
(
ends_with
(
file
,
".pb"
))
file_
type
=
"tf"
;
}
}
std
::
cout
<<
"Reading: "
<<
file
<<
std
::
endl
;
std
::
cout
<<
"Reading: "
<<
file
<<
std
::
endl
;
if
(
type
==
"onnx"
)
if
(
file_
type
==
"onnx"
)
p
=
parse_onnx
(
file
);
p
=
parse_onnx
(
file
);
else
if
(
type
==
"tf"
)
else
if
(
file_
type
==
"tf"
)
p
=
parse_tf
(
file
,
is_nhwc
);
p
=
parse_tf
(
file
,
is_nhwc
);
if
(
trim
>
0
)
if
(
trim
>
0
)
{
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment