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
b2efe895
Commit
b2efe895
authored
Jun 21, 2022
by
charlie
Browse files
Merge branch 'develop' of github.com:ROCmSoftwarePlatform/AMDMIGraphX into nonstd_NMS
parents
e4759983
c0398ded
Changes
24
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
47 additions
and
1 deletion
+47
-1
test/tf/gen_tf_pb.py
test/tf/gen_tf_pb.py
+10
-0
test/tf/relu6_mismatch_test.pb
test/tf/relu6_mismatch_test.pb
+8
-0
test/tf/tf_test.cpp
test/tf/tf_test.cpp
+25
-0
tools/include/allocation_model.hpp
tools/include/allocation_model.hpp
+4
-1
No files found.
test/tf/gen_tf_pb.py
View file @
b2efe895
...
@@ -471,6 +471,15 @@ def relu6_test(g1):
...
@@ -471,6 +471,15 @@ def relu6_test(g1):
tf
.
nn
.
relu6
(
g1_input
,
'relu6'
)
tf
.
nn
.
relu6
(
g1_input
,
'relu6'
)
@
tf_test
def
relu6_mismatch_test
(
g1
):
with
g1
.
as_default
():
g1_input
=
tf
.
compat
.
v1
.
placeholder
(
tf
.
float16
,
shape
=
(
1
,
3
,
13
,
37
),
name
=
'0'
)
tf
.
nn
.
relu6
(
g1_input
,
'relu6'
)
@
tf_test
@
tf_test
def
reshape_test
(
g1
):
def
reshape_test
(
g1
):
with
g1
.
as_default
():
with
g1
.
as_default
():
...
@@ -676,6 +685,7 @@ if __name__ == '__main__':
...
@@ -676,6 +685,7 @@ if __name__ == '__main__':
pow_test
()
pow_test
()
relu_test
()
relu_test
()
relu6_test
()
relu6_test
()
relu6_mismatch_test
()
reshape_test
()
reshape_test
()
rsqrt_test
()
rsqrt_test
()
shape_test
()
shape_test
()
...
...
test/tf/relu6_mismatch_test.pb
0 → 100644
View file @
b2efe895
:
0Placeholder*
dtype0*
shape: %
relu6Relu60*
T0"
\ No newline at end of file
test/tf/tf_test.cpp
View file @
b2efe895
...
@@ -706,6 +706,31 @@ TEST_CASE(relu6_test)
...
@@ -706,6 +706,31 @@ TEST_CASE(relu6_test)
EXPECT
(
p
==
prog
);
EXPECT
(
p
==
prog
);
}
}
TEST_CASE
(
relu6_mismatch_test
)
{
migraphx
::
program
p
;
auto
*
mm
=
p
.
get_main_module
();
std
::
vector
<
size_t
>
input_lens
{
1
,
3
,
13
,
37
};
auto
l0
=
mm
->
add_parameter
(
"0"
,
migraphx
::
shape
{
migraphx
::
shape
::
half_type
,
input_lens
});
auto
min_val
=
mm
->
add_literal
(
0.0
f
);
auto
max_val
=
mm
->
add_literal
(
6.0
f
);
auto
l0_convert
=
mm
->
add_instruction
(
migraphx
::
make_op
(
"convert"
,
{{
"target_type"
,
migraphx
::
shape
::
float_type
}}),
l0
);
min_val
=
mm
->
add_instruction
(
migraphx
::
make_op
(
"multibroadcast"
,
{{
"out_lens"
,
input_lens
}}),
min_val
);
max_val
=
mm
->
add_instruction
(
migraphx
::
make_op
(
"multibroadcast"
,
{{
"out_lens"
,
input_lens
}}),
max_val
);
mm
->
add_instruction
(
migraphx
::
make_op
(
"clip"
),
l0_convert
,
min_val
,
max_val
);
auto
prog
=
optimize_tf
(
"relu6_mismatch_test.pb"
,
false
);
EXPECT
(
p
==
prog
);
}
TEST_CASE
(
reshape_test
)
TEST_CASE
(
reshape_test
)
{
{
migraphx
::
program
p
;
migraphx
::
program
p
;
...
...
tools/include/allocation_model.hpp
View file @
b2efe895
...
@@ -28,6 +28,8 @@ struct allocation_model
...
@@ -28,6 +28,8 @@ struct allocation_model
operation
allocate
(
const
shape
&
s
)
const
;
operation
allocate
(
const
shape
&
s
)
const
;
/// Create a preallocated operator for the given shape
/// Create a preallocated operator for the given shape
operation
preallocate
(
const
shape
&
s
,
const
std
::
string
&
id
)
const
;
operation
preallocate
(
const
shape
&
s
,
const
std
::
string
&
id
)
const
;
/// Check if outputs are to be inserted
bool
needs_out_params
()
const
;
};
};
#else
#else
...
@@ -37,7 +39,8 @@ interface('allocation_model',
...
@@ -37,7 +39,8 @@ interface('allocation_model',
virtual
(
'
name
'
,
returns
=
'
std
::
string
'
,
const
=
True
),
virtual
(
'
name
'
,
returns
=
'
std
::
string
'
,
const
=
True
),
virtual
(
'
copy
'
,
returns
=
'
std
::
string
'
,
const
=
True
),
virtual
(
'
copy
'
,
returns
=
'
std
::
string
'
,
const
=
True
),
virtual
(
'
allocate
'
,
s
=
'
const
shape
&
'
,
returns
=
'
operation
'
,
const
=
True
),
virtual
(
'
allocate
'
,
s
=
'
const
shape
&
'
,
returns
=
'
operation
'
,
const
=
True
),
virtual
(
'
preallocate
'
,
s
=
'
const
shape
&
'
,
id
=
'
std
::
string
'
,
returns
=
'
operation
'
,
const
=
True
)
virtual
(
'
preallocate
'
,
s
=
'
const
shape
&
'
,
id
=
'
std
::
string
'
,
returns
=
'
operation
'
,
const
=
True
),
virtual
(
'
needs_out_params
'
,
returns
=
'
bool
'
,
const
=
True
)
)
)
%>
%>
...
...
Prev
1
2
Next
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