Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gaoqiong
MIGraphX
Commits
6b569e6b
Commit
6b569e6b
authored
Nov 09, 2021
by
Shucai Xiao
Committed by
Ted Themistokleous
Jan 06, 2023
Browse files
covert fp16 to fp32 for parsing lrn operator
parent
0d197f27
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
1 deletion
+39
-1
src/onnx/parse_generic_op.cpp
src/onnx/parse_generic_op.cpp
+0
-1
src/onnx/parse_lrn.cpp
src/onnx/parse_lrn.cpp
+39
-0
No files found.
src/onnx/parse_generic_op.cpp
View file @
6b569e6b
...
...
@@ -56,7 +56,6 @@ struct parse_generic_op : op_parser<parse_generic_op>
{
"IsNaN"
,
"isnan"
},
{
"LeakyRelu"
,
"leaky_relu"
},
{
"Log"
,
"log"
},
{
"LRN"
,
"lrn"
},
{
"Neg"
,
"neg"
},
{
"Reciprocal"
,
"recip"
},
{
"Relu"
,
"relu"
},
...
...
src/onnx/parse_lrn.cpp
0 → 100644
View file @
6b569e6b
#include <migraphx/onnx/op_parser.hpp>
#include <migraphx/ranges.hpp>
#include <migraphx/make_op.hpp>
#include <migraphx/instruction.hpp>
namespace
migraphx
{
inline
namespace
MIGRAPHX_INLINE_NS
{
namespace
onnx
{
struct
parse_lrn
:
op_parser
<
parse_lrn
>
{
std
::
vector
<
op_desc
>
operators
()
const
{
return
{{
"LRN"
,
"lrn"
}};
}
instruction_ref
parse
(
const
op_desc
&
opd
,
const
onnx_parser
&
parser
,
onnx_parser
::
node_info
info
,
std
::
vector
<
instruction_ref
>
args
)
const
{
auto
op
=
parser
.
load
(
opd
.
op_name
,
info
);
auto
&
arg
=
args
.
front
();
auto
type
=
arg
->
get_shape
().
type
();
if
(
type
==
shape
::
half_type
)
{
arg
=
info
.
add_instruction
(
make_op
(
"convert"
,
{{
"target_type"
,
shape
::
float_type
}}),
arg
);
}
auto
ret
=
info
.
add_instruction
(
op
,
arg
);
if
(
type
==
shape
::
half_type
)
{
ret
=
info
.
add_instruction
(
make_op
(
"convert"
,
{{
"target_type"
,
shape
::
half_type
}}),
ret
);
}
return
ret
;
}
};
}
// namespace onnx
}
// namespace MIGRAPHX_INLINE_NS
}
// namespace migraphx
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