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
711ff872
Commit
711ff872
authored
Nov 09, 2023
by
Umang Yadav
Browse files
Merge remote-tracking branch 'origin/develop' into fp8_rocblas
parents
8bfb5e56
200c7038
Changes
34
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
142 additions
and
66 deletions
+142
-66
test/onnx/reshape_variable_input_test1.onnx
test/onnx/reshape_variable_input_test1.onnx
+0
-0
test/onnx/round_half_test.onnx
test/onnx/round_half_test.onnx
+13
-0
test/onnx/slice_var_input_default_steps.onnx
test/onnx/slice_var_input_default_steps.onnx
+0
-0
test/onnx/verify_onnx.cpp
test/onnx/verify_onnx.cpp
+37
-0
test/py/CMakeLists.txt
test/py/CMakeLists.txt
+13
-5
test/py/onnx_backend_test.py
test/py/onnx_backend_test.py
+0
-1
test/py/requirements.txt
test/py/requirements.txt
+0
-25
test/py/test_gpu.py
test/py/test_gpu.py
+20
-12
test/ref/nearbyint.cpp
test/ref/nearbyint.cpp
+43
-11
test/ref/quantizelinear.cpp
test/ref/quantizelinear.cpp
+2
-2
test/ref/reshape.cpp
test/ref/reshape.cpp
+0
-1
test/simplify_reshapes_test.cpp
test/simplify_reshapes_test.cpp
+2
-2
test/verify/test_nearbyint.cpp
test/verify/test_nearbyint.cpp
+11
-6
tools/accuracy/requirements.txt
tools/accuracy/requirements.txt
+1
-1
No files found.
test/onnx/reshape_variable_input_test1.onnx
0 → 100644
View file @
711ff872
File added
test/onnx/round_half_test.onnx
0 → 100644
View file @
711ff872
round_half_test:J
xy"Roundround_half_testZ
x
b
y
B
\ No newline at end of file
test/onnx/slice_var_input_default_steps.onnx
0 → 100644
View file @
711ff872
File added
test/onnx/verify_onnx.cpp
View file @
711ff872
...
...
@@ -2056,6 +2056,43 @@ TEST_CASE(reversesequence_time_verify_test)
EXPECT
(
migraphx
::
verify
::
verify_rms_range
(
result_vector
,
gold
));
}
TEST_CASE
(
round_half_test
)
{
migraphx
::
program
p
=
migraphx
::
parse_onnx
(
"round_half_test.onnx"
);
p
.
compile
(
migraphx
::
make_target
(
"ref"
));
migraphx
::
shape
xs
{
migraphx
::
shape
::
half_type
,
{
4
,
4
}};
std
::
vector
<
float
>
tmp
=
{
-
3.51
,
-
3.5
,
-
3.49
,
-
2.51
,
-
2.50
,
-
2.49
,
-
1.6
,
-
1.5
,
-
0.51
,
-
0.5
,
0.5
,
0.6
,
2.4
,
2.5
,
3.5
,
4.5
};
std
::
vector
<
migraphx
::
half
>
data
{
tmp
.
cbegin
(),
tmp
.
cend
()};
migraphx
::
parameter_map
param_map
;
param_map
[
"x"
]
=
migraphx
::
argument
(
xs
,
data
.
data
());
auto
result
=
p
.
eval
(
param_map
).
back
();
std
::
vector
<
migraphx
::
half
>
result_vector
;
result
.
visit
([
&
](
auto
output
)
{
result_vector
.
assign
(
output
.
begin
(),
output
.
end
());
});
tmp
=
{
-
4.0
,
-
4.0
,
-
3.0
,
-
3.0
,
-
2.0
,
-
2.0
,
-
2.0
,
-
2.0
,
-
1.0
,
0.0
,
0.0
,
1.0
,
2.0
,
2.0
,
4.0
,
4.0
};
std
::
vector
<
migraphx
::
half
>
gold
{
tmp
.
cbegin
(),
tmp
.
cend
()};
EXPECT
(
migraphx
::
verify
::
verify_rms_range
(
result_vector
,
gold
));
}
TEST_CASE
(
selu_test
)
{
migraphx
::
program
p
=
migraphx
::
parse_onnx
(
"selu_test.onnx"
);
...
...
test/py/CMakeLists.txt
View file @
711ff872
...
...
@@ -41,13 +41,21 @@ function(add_py_venv_fixture FIXTURE_NAME VIRTUAL_ENV_DIR REQUIREMENTS_FILE)
set
(
PYTHON_EXECUTABLE
${
PYTHON_
${
PYTHON_VERSION
}
_EXECUTABLE
}
)
if
(
NOT TEST py_
${
PYTHON_VERSION
}
_
${
FIXTURE_NAME
}
_initialize_env
)
if
(
NOT
(
${
PYTHON_VERSION
}
STREQUAL
${
PYTHON_VERSION_TO_DISABLE_ONNX
}
))
if
(
NOT
(
${
FIXTURE_NAME
}
STREQUAL
"onnx"
AND
${
PYTHON_VERSION
}
STREQUAL
${
PYTHON_VERSION_TO_DISABLE_ONNX
}
))
add_test
(
NAME py_
${
PYTHON_VERSION
}
_
${
FIXTURE_NAME
}
_initialize_env COMMAND
${
PYTHON_EXECUTABLE
}
-m venv
${
VIRTUAL_ENV_DIR
}
/
${
PYTHON_VERSION
}
--clear
)
set_tests_properties
(
py_
${
PYTHON_VERSION
}
_
${
FIXTURE_NAME
}
_initialize_env PROPERTIES FIXTURES_SETUP
${
FIXTURE_NAME
}
_
${
PYTHON_VERSION
}
_INIT_VENV
)
set
(
PYTHON_EXECUTABLE
${
VIRTUAL_ENV_DIR
}
/
${
PYTHON_VERSION
}
/bin/python
)
add_test
(
NAME py_
${
PYTHON_VERSION
}
_
${
FIXTURE_NAME
}
_setup_env
COMMAND
${
PYTHON_EXECUTABLE
}
-m pip install -r
${
REQUIREMENTS_FILE
}
)
if
(
EXISTS
${
REQUIREMENTS_FILE
}
)
add_test
(
NAME py_
${
PYTHON_VERSION
}
_
${
FIXTURE_NAME
}
_setup_env
COMMAND
${
PYTHON_EXECUTABLE
}
-m pip install -r
${
REQUIREMENTS_FILE
}
)
else
()
# If there is no requirements file, then there are no packages to install in the virtual env.
# Just create a placeholder test for setting up the required fixture for running the tests.
add_test
(
NAME py_
${
PYTHON_VERSION
}
_
${
FIXTURE_NAME
}
_setup_env
COMMAND
${
PYTHON_EXECUTABLE
}
-m pip install --help
)
endif
()
set_tests_properties
(
py_
${
PYTHON_VERSION
}
_
${
FIXTURE_NAME
}
_setup_env PROPERTIES FIXTURES_REQUIRED
${
FIXTURE_NAME
}
_
${
PYTHON_VERSION
}
_INIT_VENV
)
set_tests_properties
(
py_
${
PYTHON_VERSION
}
_
${
FIXTURE_NAME
}
_setup_env PROPERTIES FIXTURES_SETUP
${
FIXTURE_NAME
}
_
${
PYTHON_VERSION
}
_VENV
)
endif
()
...
...
@@ -67,7 +75,7 @@ function(add_py_test NAME SCRIPT FIXTURE_NAME VENV_DIR)
else
()
set
(
PYTHON_EXECUTABLE
${
VENV_DIR
}
/
${
PYTHON_VERSION
}
/bin/python
)
endif
()
if
(
NOT
${
PYTHON_VERSION
}
STREQUAL
${
PYTHON_VERSION_TO_DISABLE_ONNX
}
)
if
(
NOT
(
${
FIXTURE_NAME
}
STREQUAL
"onnx"
AND
${
PYTHON_VERSION
}
STREQUAL
${
PYTHON_VERSION_TO_DISABLE_ONNX
}
)
)
add_test
(
NAME test_py_
${
PYTHON_VERSION
}
_
${
NAME
}
COMMAND
${
ENV_COMMAND
}
${
PYTHON_EXECUTABLE
}
${
CMAKE_CURRENT_SOURCE_DIR
}
/
${
SCRIPT
}
${
ARGN
}
)
...
...
test/py/onnx_backend_test.py
View file @
711ff872
...
...
@@ -83,7 +83,6 @@ def disabled_tests_onnx_1_7_0(backend_test):
backend_test
.
exclude
(
r
'test_nonmaxsuppression_two_batches_cpu'
)
backend_test
.
exclude
(
r
'test_nonmaxsuppression_two_classes_cpu'
)
backend_test
.
exclude
(
r
'test_nonzero_example_cpu'
)
backend_test
.
exclude
(
r
'test_round_cpu'
)
backend_test
.
exclude
(
r
'test_softmax_axis_0_cpu'
)
backend_test
.
exclude
(
r
'test_softmax_axis_1_cpu'
)
backend_test
.
exclude
(
r
'test_softmax_default_axis_cpu'
)
...
...
test/py/requirements.txt
deleted
100644 → 0
View file @
8bfb5e56
#####################################################################################
# The MIT License (MIT)
#
# Copyright (c) 2015-2023 Advanced Micro Devices, Inc. All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#####################################################################################
numpy==1.21.6
test/py/test_gpu.py
View file @
711ff872
...
...
@@ -22,7 +22,6 @@
# THE SOFTWARE.
#####################################################################################
import
migraphx
import
numpy
as
np
def
test_conv_relu
():
...
...
@@ -51,8 +50,12 @@ def test_sub_uint64():
params
=
{}
shapes
=
p
.
get_parameter_shapes
()
params
[
"0"
]
=
np
.
arange
(
120
).
reshape
(
shapes
[
"0"
].
lens
()).
astype
(
np
.
uint64
)
params
[
"1"
]
=
np
.
arange
(
20
).
reshape
(
shapes
[
"1"
].
lens
()).
astype
(
np
.
uint64
)
params
[
"0"
]
=
migraphx
.
create_argument
(
migraphx
.
shape
(
type
=
'uint64_type'
,
lens
=
shapes
[
"0"
].
lens
()),
list
(
range
(
120
)))
params
[
"1"
]
=
migraphx
.
create_argument
(
migraphx
.
shape
(
type
=
'uint64_type'
,
lens
=
shapes
[
"1"
].
lens
()),
list
(
range
(
20
)))
r
=
p
.
run
(
params
)
print
(
r
)
...
...
@@ -67,7 +70,9 @@ def test_neg_int64():
params
=
{}
shapes
=
p
.
get_parameter_shapes
()
params
[
"0"
]
=
np
.
arange
(
6
).
reshape
(
shapes
[
"0"
].
lens
()).
astype
(
np
.
int64
)
params
[
"0"
]
=
migraphx
.
create_argument
(
migraphx
.
shape
(
type
=
'int64_type'
,
lens
=
shapes
[
"0"
].
lens
()),
list
(
range
(
6
)))
r
=
p
.
run
(
params
)
print
(
r
)
...
...
@@ -82,8 +87,9 @@ def test_nonzero():
params
=
{}
shapes
=
p
.
get_parameter_shapes
()
params
[
"data"
]
=
np
.
array
([
1
,
1
,
0
,
1
]).
reshape
(
shapes
[
"data"
].
lens
()).
astype
(
bool
)
params
[
"data"
]
=
migraphx
.
create_argument
(
migraphx
.
shape
(
type
=
'bool_type'
,
lens
=
shapes
[
"data"
].
lens
()),
[
1
,
1
,
0
,
1
])
r
=
p
.
run
(
params
)
print
(
r
)
...
...
@@ -101,8 +107,8 @@ def test_fp16_imagescaler():
params
=
{}
shapes
=
p
.
get_parameter_shapes
()
params
[
"0"
]
=
np
.
random
.
randn
(
768
).
reshape
(
shapes
[
"0"
].
lens
()).
astype
(
np
.
float16
)
params
[
"0"
]
=
migraphx
.
generate_argument
(
migraphx
.
shape
(
type
=
'half_type'
,
lens
=
shapes
[
"0"
].
lens
()),
768
)
r
=
p
.
run
(
params
)[
-
1
]
print
(
r
)
...
...
@@ -120,10 +126,12 @@ def test_if_pl():
params
=
{}
shapes
=
p
.
get_parameter_shapes
()
params
[
"x"
]
=
np
.
ones
(
6
).
reshape
(
shapes
[
"x"
].
lens
()).
astype
(
np
.
float32
)
params
[
"y"
]
=
np
.
array
([
2.0
,
2.0
,
2.0
,
2.0
,
2.0
,
2.0
,
2.0
,
2.0
,
2.0
]).
reshape
(
shapes
[
"y"
].
lens
()).
astype
(
np
.
float32
)
params
[
"cond"
]
=
np
.
array
([
1
]).
reshape
(()).
astype
(
bool
)
params
[
"x"
]
=
migraphx
.
fill_argument
(
migraphx
.
shape
(
type
=
'float_type'
,
lens
=
shapes
[
"x"
].
lens
()),
1
)
params
[
"y"
]
=
migraphx
.
fill_argument
(
migraphx
.
shape
(
type
=
'float_type'
,
lens
=
shapes
[
"y"
].
lens
()),
2.0
)
params
[
"cond"
]
=
migraphx
.
fill_argument
(
migraphx
.
shape
(
type
=
"bool"
,
lens
=
[
1
],
strides
=
[
0
]),
1
)
r
=
p
.
run
(
params
)[
-
1
]
print
(
r
)
...
...
test/ref/
round
.cpp
→
test/ref/
nearbyint
.cpp
View file @
711ff872
...
...
@@ -30,39 +30,71 @@
#include <test.hpp>
TEST_CASE
(
round
_test
)
TEST_CASE
(
nearbyint
_test
)
{
migraphx
::
program
p
;
auto
*
mm
=
p
.
get_main_module
();
migraphx
::
shape
s
{
migraphx
::
shape
::
float_type
,
{
9
}};
auto
l
=
mm
->
add_literal
(
migraphx
::
literal
{
s
,
{
1.1
,
1.5
,
1.6
,
-
1.1
,
-
1.5
,
-
1.6
,
0.0
,
2.0
,
-
2.0
}});
mm
->
add_instruction
(
migraphx
::
make_op
(
"round"
),
l
);
migraphx
::
shape
s
{
migraphx
::
shape
::
float_type
,
{
4
,
4
}};
auto
l
=
mm
->
add_literal
(
migraphx
::
literal
{
s
,
{
-
3.51
,
-
3.5
,
-
3.49
,
-
2.51
,
-
2.50
,
-
2.49
,
-
1.6
,
-
1.5
,
-
0.51
,
-
0.5
,
0.5
,
0.6
,
2.4
,
2.5
,
3.5
,
4.5
}});
mm
->
add_instruction
(
migraphx
::
make_op
(
"nearbyint"
),
l
);
p
.
compile
(
migraphx
::
make_target
(
"ref"
));
auto
result
=
p
.
eval
({}).
back
();
std
::
vector
<
float
>
results_vector
;
result
.
visit
([
&
](
auto
output
)
{
results_vector
.
assign
(
output
.
begin
(),
output
.
end
());
});
std
::
vector
<
float
>
gold
=
{
1.0
,
2.0
,
2.0
,
-
1.0
,
-
2.0
,
-
2.0
,
0.0
,
2.0
,
-
2.0
};
std
::
vector
<
float
>
gold
=
{
-
4.0
,
-
4.0
,
-
3.0
,
-
3.0
,
-
2.0
,
-
2.0
,
-
2.0
,
-
2.0
,
-
1.0
,
0.0
,
0.0
,
1.0
,
2.0
,
2.0
,
4.0
,
4.0
};
EXPECT
(
migraphx
::
verify
::
verify_rms_range
(
results_vector
,
gold
));
}
TEST_CASE
(
round
_dyn_test
)
TEST_CASE
(
nearbyint
_dyn_test
)
{
migraphx
::
program
p
;
auto
*
mm
=
p
.
get_main_module
();
migraphx
::
shape
::
dynamic_dimension
dd
{
4
,
10
};
migraphx
::
shape
s
{
migraphx
::
shape
::
float_type
,
{
dd
}};
auto
input
=
mm
->
add_parameter
(
"X"
,
s
);
mm
->
add_instruction
(
migraphx
::
make_op
(
"
round
"
),
input
);
mm
->
add_instruction
(
migraphx
::
make_op
(
"
nearbyint
"
),
input
);
p
.
compile
(
migraphx
::
make_target
(
"ref"
));
std
::
vector
<
float
>
input_data
{
1.1
,
1.5
,
1.6
,
-
1.1
,
-
1.5
,
-
1.6
,
0.0
,
2.0
,
-
2.0
};
std
::
vector
<
float
>
input_data
{
-
3.51
,
-
3.5
,
-
3.49
,
-
2.51
,
-
2.50
,
-
2.49
,
-
1.6
,
-
1.5
,
-
0.51
,
-
0.5
,
0.5
,
0.6
,
2.4
,
2.5
,
3.5
,
4.5
};
migraphx
::
parameter_map
params0
;
migraphx
::
shape
input_fixed_shape0
{
migraphx
::
shape
::
float_type
,
{
9
}};
migraphx
::
shape
input_fixed_shape0
{
migraphx
::
shape
::
float_type
,
{
16
}};
params0
[
"X"
]
=
migraphx
::
argument
(
input_fixed_shape0
,
input_data
.
data
());
auto
result
=
p
.
eval
(
params0
).
back
();
std
::
vector
<
float
>
results_vector
;
result
.
visit
([
&
](
auto
output
)
{
results_vector
.
assign
(
output
.
begin
(),
output
.
end
());
});
std
::
vector
<
float
>
gold
=
{
1.0
,
2.0
,
2.0
,
-
1.0
,
-
2.0
,
-
2.0
,
0.0
,
2.0
,
-
2.0
};
std
::
vector
<
float
>
gold
=
{
-
4.0
,
-
4.0
,
-
3.0
,
-
3.0
,
-
2.0
,
-
2.0
,
-
2.0
,
-
2.0
,
-
1.0
,
0.0
,
0.0
,
1.0
,
2.0
,
2.0
,
4.0
,
4.0
};
EXPECT
(
migraphx
::
verify
::
verify_rms_range
(
results_vector
,
gold
));
}
test/ref/quantizelinear.cpp
View file @
711ff872
...
...
@@ -55,7 +55,7 @@ TEST_CASE(quantizelinear_1)
std
::
vector
<
float
>
results_vector
(
18
);
result
.
visit
([
&
](
auto
output
)
{
results_vector
.
assign
(
output
.
begin
(),
output
.
end
());
});
std
::
vector
<
float
>
gold
{
-
128
,
127
,
6
5
,
-
128
,
1
,
1
,
-
1
,
100
,
92
,
-
128
,
127
,
6
5
,
-
128
,
1
,
1
,
-
1
,
100
,
92
};
-
128
,
127
,
6
4
,
-
128
,
1
,
1
,
-
1
,
100
,
92
,
-
128
,
127
,
6
4
,
-
128
,
1
,
1
,
-
1
,
100
,
92
};
EXPECT
(
results_vector
==
gold
);
}
...
...
@@ -80,6 +80,6 @@ TEST_CASE(quantizelinear_2)
auto
result
=
p1
.
eval
({}).
back
();
std
::
vector
<
float
>
results_vector
(
18
);
result
.
visit
([
&
](
auto
output
)
{
results_vector
.
assign
(
output
.
begin
(),
output
.
end
());
});
std
::
vector
<
float
>
gold
{
0
,
255
,
6
5
,
0
,
2
,
2
,
0
,
255
,
255
,
0
,
255
,
6
5
,
0
,
2
,
2
,
0
,
255
,
255
};
std
::
vector
<
float
>
gold
{
0
,
255
,
6
4
,
0
,
2
,
2
,
0
,
255
,
255
,
0
,
255
,
6
4
,
0
,
2
,
2
,
0
,
255
,
255
};
EXPECT
(
results_vector
==
gold
);
}
test/ref/reshape.cpp
View file @
711ff872
...
...
@@ -226,7 +226,6 @@ TEST_CASE(reshape_2in_test1)
result
.
visit
([
&
](
auto
output
)
{
results_vector
.
assign
(
output
.
begin
(),
output
.
end
());
});
EXPECT
(
migraphx
::
verify
::
verify_rms_range
(
results_vector
,
gold
));
}
TEST_CASE
(
reshape_2in_elements_runtime_error
)
{
migraphx
::
program
p
;
...
...
test/simplify_reshapes_test.cpp
View file @
711ff872
...
...
@@ -1345,7 +1345,7 @@ TEST_CASE(transpose_contiguous_unsqueeze_unary)
auto
cont_ins
=
m1
.
add_instruction
(
migraphx
::
make_op
(
"contiguous"
),
transpose_ins
);
auto
unsq_ins
=
m1
.
add_instruction
(
migraphx
::
make_op
(
"unsqueeze"
,
{{
"axes"
,
{
2
}}}),
cont_ins
);
auto
round
=
m1
.
add_instruction
(
migraphx
::
make_op
(
"
round
"
),
unsq_ins
);
auto
round
=
m1
.
add_instruction
(
migraphx
::
make_op
(
"
nearbyint
"
),
unsq_ins
);
m1
.
add_instruction
(
pass_op
{},
round
);
}
run_pass
(
m1
);
...
...
@@ -1354,7 +1354,7 @@ TEST_CASE(transpose_contiguous_unsqueeze_unary)
auto
x
=
m2
.
add_parameter
(
"x"
,
{
migraphx
::
shape
::
float_type
,
{
2
,
8
,
5
,
5
}});
auto
transpose_ins
=
m2
.
add_instruction
(
migraphx
::
make_op
(
"transpose"
,
{{
"permutation"
,
{
0
,
2
,
3
,
1
}}}),
x
);
auto
round
=
m2
.
add_instruction
(
migraphx
::
make_op
(
"
round
"
),
transpose_ins
);
auto
round
=
m2
.
add_instruction
(
migraphx
::
make_op
(
"
nearbyint
"
),
transpose_ins
);
auto
cont_ins
=
m2
.
add_instruction
(
migraphx
::
make_op
(
"contiguous"
),
round
);
auto
unsq_ins
=
m2
.
add_instruction
(
migraphx
::
make_op
(
"unsqueeze"
,
{{
"axes"
,
{
2
}}}),
cont_ins
);
...
...
test/verify/test_
round
.cpp
→
test/verify/test_
nearbyint
.cpp
View file @
711ff872
/*
* The MIT License (MIT)
*
* Copyright (c) 2015-202
2
Advanced Micro Devices, Inc. All rights reserved.
* Copyright (c) 2015-202
3
Advanced Micro Devices, Inc. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
...
...
@@ -27,16 +27,21 @@
#include <migraphx/generate.hpp>
#include <migraphx/make_op.hpp>
struct
test_round
:
verify_program
<
test_round
>
template
<
class
T
>
struct
test_nearbyint
:
verify_program
<
test_nearbyint
<
T
>>
{
migraphx
::
program
create_program
()
const
{
migraphx
::
program
p
;
std
::
vector
<
float
>
tmp
{
-
4.5
,
-
3.5
,
0.5
,
2.5
,
3.5
};
std
::
vector
<
T
>
data
{
tmp
.
cbegin
(),
tmp
.
cend
()};
migraphx
::
shape
s1
{
migraphx
::
shape
::
get_type
<
T
>
(),
{
5
}};
auto
*
mm
=
p
.
get_main_module
();
migraphx
::
shape
s
{
migraphx
::
shape
::
float_type
,
{
2
,
3
,
4
,
6
}};
auto
param
=
mm
->
add_parameter
(
"x"
,
s
);
mm
->
add_instruction
(
migraphx
::
make_op
(
"round"
),
param
);
auto
l0
=
mm
->
add_literal
(
migraphx
::
literal
{
s1
,
data
});
mm
->
add_instruction
(
migraphx
::
make_op
(
"isinf"
),
l0
);
return
p
;
};
};
template
struct
test_nearbyint
<
migraphx
::
half
>;
template
struct
test_nearbyint
<
float
>;
tools/accuracy/requirements.txt
View file @
711ff872
...
...
@@ -22,4 +22,4 @@
# THE SOFTWARE.
#####################################################################################
numpy==1.21.6
onnxruntime==1.16.
1
onnxruntime==1.16.
2
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