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
15a7d96a
Commit
15a7d96a
authored
Nov 29, 2022
by
Paul
Browse files
Merge from develop
parents
4c370d64
eb094e57
Changes
155
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
650 additions
and
52 deletions
+650
-52
src/tf/parse_conv.cpp
src/tf/parse_conv.cpp
+0
-5
src/tf/parse_depthwiseconv.cpp
src/tf/parse_depthwiseconv.cpp
+0
-5
test/api/test_custom_op_gpu.cpp
test/api/test_custom_op_gpu.cpp
+7
-4
test/fuse_pointwise.cpp
test/fuse_pointwise.cpp
+29
-0
test/gpu/literal.cpp
test/gpu/literal.cpp
+1
-1
test/gpu/mlir.cpp
test/gpu/mlir.cpp
+3
-3
test/gpu/quantization.cpp
test/gpu/quantization.cpp
+0
-1
test/layout_nhwc.cpp
test/layout_nhwc.cpp
+127
-0
test/onnx/batch_norm_rank_2_test.onnx
test/onnx/batch_norm_rank_2_test.onnx
+32
-0
test/onnx/binary_dyn_brcst_add_test.onnx
test/onnx/binary_dyn_brcst_add_test.onnx
+0
-0
test/onnx/binary_dyn_brcst_attr_error_test.onnx
test/onnx/binary_dyn_brcst_attr_error_test.onnx
+0
-0
test/onnx/binary_dyn_brcst_mul_test.onnx
test/onnx/binary_dyn_brcst_mul_test.onnx
+0
-0
test/onnx/binary_dyn_brcst_prelu_test.onnx
test/onnx/binary_dyn_brcst_prelu_test.onnx
+0
-0
test/onnx/gen_onnx.py
test/onnx/gen_onnx.py
+196
-17
test/onnx/neg_dynamic_test.onnx
test/onnx/neg_dynamic_test.onnx
+0
-0
test/onnx/onnx_test.cpp
test/onnx/onnx_test.cpp
+178
-16
test/onnx/sinh_dynamic_test.onnx
test/onnx/sinh_dynamic_test.onnx
+0
-0
test/onnx/split_test_invalid_split.onnx
test/onnx/split_test_invalid_split.onnx
+25
-0
test/onnx/split_test_no_attribute.onnx
test/onnx/split_test_no_attribute.onnx
+26
-0
test/onnx/split_test_no_attribute_invalid_input_split.onnx
test/onnx/split_test_no_attribute_invalid_input_split.onnx
+26
-0
No files found.
src/tf/parse_conv.cpp
View file @
15a7d96a
...
...
@@ -75,7 +75,6 @@ struct parse_conv : op_parser<parse_conv>
const
std
::
string
&
pad_mode
=
info
.
attributes
.
at
(
"padding"
).
s
();
if
(
pad_mode
.
find
(
"SAME"
)
!=
std
::
string
::
npos
)
{
op
.
padding_mode
=
op
::
padding_mode_t
::
same
;
std
::
vector
<
size_t
>
weight_dims
=
weights
->
get_shape
().
lens
();
size_t
weight_h
=
weight_dims
[
2
];
size_t
weight_w
=
weight_dims
[
3
];
...
...
@@ -87,10 +86,6 @@ struct parse_conv : op_parser<parse_conv>
op
.
padding
=
std
::
vector
<
size_t
>
(
pads
.
begin
(),
pads
.
end
());
}
else
if
(
pad_mode
.
find
(
"VALID"
)
!=
std
::
string
::
npos
)
{
op
.
padding_mode
=
op
::
padding_mode_t
::
valid
;
}
else
if
(
pad_mode
.
find
(
"EXPLICIT"
)
!=
std
::
string
::
npos
)
{
std
::
vector
<
size_t
>
padding
;
...
...
src/tf/parse_depthwiseconv.cpp
View file @
15a7d96a
...
...
@@ -80,7 +80,6 @@ struct parse_depthwiseconv : op_parser<parse_depthwiseconv>
if
(
pad_mode
.
find
(
"SAME"
)
!=
std
::
string
::
npos
)
{
op
.
padding_mode
=
op
::
padding_mode_t
::
same
;
std
::
vector
<
size_t
>
weight_dims
=
weights
->
get_shape
().
lens
();
size_t
weight_h
=
weight_dims
[
2
];
size_t
weight_w
=
weight_dims
[
3
];
...
...
@@ -101,10 +100,6 @@ struct parse_depthwiseconv : op_parser<parse_depthwiseconv>
op
.
padding
[
1
]
=
pads
[
1
];
}
}
else
if
(
pad_mode
.
find
(
"VALID"
)
!=
std
::
string
::
npos
)
{
op
.
padding_mode
=
op
::
padding_mode_t
::
valid
;
}
}
std
::
vector
<
int64_t
>
new_weights_shape
;
...
...
test/api/test_custom_op_gpu.cpp
View file @
15a7d96a
...
...
@@ -55,7 +55,8 @@ struct half_copy_host final : migraphx::experimental_custom_op_base
hipMemcpyHostToHost
,
ctx
.
get_queue
<
hipStream_t
>
()));
MIGRAPHX_HIP_ASSERT
(
hipDeviceSynchronize
());
MIGRAPHX_HIP_ASSERT
(
hipMemset
(
output_buffer_ptr
,
0
,
copy_bytes
));
MIGRAPHX_HIP_ASSERT
(
hipMemsetAsync
(
output_buffer_ptr
,
0
,
copy_bytes
,
ctx
.
get_queue
<
hipStream_t
>
()));
MIGRAPHX_HIP_ASSERT
(
hipDeviceSynchronize
());
return
inputs
[
1
];
}
...
...
@@ -97,7 +98,8 @@ struct half_copy_device final : migraphx::experimental_custom_op_base
hipMemcpyDeviceToDevice
,
ctx
.
get_queue
<
hipStream_t
>
()));
MIGRAPHX_HIP_ASSERT
(
hipDeviceSynchronize
());
MIGRAPHX_HIP_ASSERT
(
hipMemset
(
output_buffer_ptr
,
0
,
copy_bytes
));
MIGRAPHX_HIP_ASSERT
(
hipMemsetAsync
(
output_buffer_ptr
,
0
,
copy_bytes
,
ctx
.
get_queue
<
hipStream_t
>
()));
MIGRAPHX_HIP_ASSERT
(
hipDeviceSynchronize
());
return
inputs
[
1
];
}
...
...
@@ -124,7 +126,7 @@ struct half_copy_device_same_buffer final : migraphx::experimental_custom_op_bas
virtual
bool
runs_on_offload_target
()
const
override
{
return
true
;
}
virtual
migraphx
::
argument
compute
(
migraphx
::
context
,
migraphx
::
shape
,
migraphx
::
arguments
inputs
)
const
override
compute
(
migraphx
::
context
ctx
,
migraphx
::
shape
,
migraphx
::
arguments
inputs
)
const
override
{
// This custom op simply sets first half size_bytes of the input 0, and rest of the half
// bytes are copied. for this custom_op, it does its computation on the "device". Therefore,
...
...
@@ -133,7 +135,8 @@ struct half_copy_device_same_buffer final : migraphx::experimental_custom_op_bas
auto
input_bytes
=
inputs
[
0
].
get_shape
().
bytes
();
auto
copy_bytes
=
input_bytes
/
2
;
MIGRAPHX_HIP_ASSERT
(
hipSetDevice
(
0
));
MIGRAPHX_HIP_ASSERT
(
hipMemset
(
buffer_ptr
,
0
,
copy_bytes
));
MIGRAPHX_HIP_ASSERT
(
hipMemsetAsync
(
buffer_ptr
,
0
,
copy_bytes
,
ctx
.
get_queue
<
hipStream_t
>
()));
MIGRAPHX_HIP_ASSERT
(
hipDeviceSynchronize
());
return
inputs
[
0
];
}
...
...
test/fuse_pointwise.cpp
View file @
15a7d96a
...
...
@@ -272,6 +272,35 @@ TEST_CASE(contiguous_input)
EXPECT
(
p1
==
p2
);
}
TEST_CASE
(
contiguous_boolean_input
)
{
migraphx
::
shape
s
{
migraphx
::
shape
::
bool_type
,
{
2
,
3
}};
migraphx
::
shape
s_lit
{
migraphx
::
shape
::
bool_type
,
{
1
},
{
0
}};
migraphx
::
program
p1
;
{
auto
*
mm
=
p1
.
get_main_module
();
auto
x
=
mm
->
add_parameter
(
"x"
,
s
);
auto
one
=
mm
->
add_literal
(
migraphx
::
literal
(
s_lit
,
{
1.0
}));
auto
yb
=
mm
->
add_instruction
(
migraphx
::
make_op
(
"multibroadcast"
,
{{
"out_lens"
,
s
.
lens
()}}),
one
);
auto
y
=
mm
->
add_instruction
(
migraphx
::
make_op
(
"contiguous"
),
yb
);
auto
xor1
=
mm
->
add_instruction
(
migraphx
::
make_op
(
"logical_xor"
),
x
,
y
);
mm
->
add_return
({
xor1
});
}
run_pass
(
p1
);
migraphx
::
program
p2
;
{
auto
*
mm
=
p2
.
get_main_module
();
auto
x
=
mm
->
add_parameter
(
"x"
,
s
);
auto
xor1
=
add_pointwise
(
p2
,
"main:pointwise0"
,
{
x
},
[
=
](
auto
*
pm
,
const
auto
&
inputs
)
{
auto
y
=
pm
->
add_literal
(
migraphx
::
literal
(
s_lit
,
{
1
}));
return
pm
->
add_instruction
(
migraphx
::
make_op
(
"logical_xor"
),
inputs
[
0
],
y
);
});
mm
->
add_return
({
xor1
});
}
}
TEST_CASE
(
all_scalar_input
)
{
migraphx
::
shape
s
{
migraphx
::
shape
::
float_type
};
...
...
test/gpu/literal.cpp
View file @
15a7d96a
...
...
@@ -48,4 +48,4 @@ void gpu_literal_test()
}
}
int
main
()
{
gpu_literal_test
();
}
int
main
()
{
gpu_literal_test
();
}
// NOLINT (bugprone-exception-escape)
test/gpu/mlir.cpp
View file @
15a7d96a
...
...
@@ -84,7 +84,7 @@ migraphx::program create_program_from_mlir(const migraphx::module& mmlir)
inputs
.
push_back
(
mm
->
add_parameter
(
"output"
,
mmlir
.
get_output_shapes
().
front
()));
migraphx
::
gpu
::
context
ctx
;
migraphx
::
gpu
::
insert_mlir
(
*
mm
,
mm
->
end
(),
compile_mlir
(
ctx
,
mmlir
),
inputs
);
migraphx
::
gpu
::
insert_mlir
(
*
mm
,
mm
->
end
(),
compile_mlir
(
ctx
,
mmlir
,
inputs
),
inputs
);
return
p
;
}
...
...
@@ -141,7 +141,7 @@ TEST_CASE(conv)
const
std
::
string
mlir_output
=
R"__migraphx__(
module {
func.func @main(%arg0: tensor<2x8x3x3xf32>, %arg1: tensor<1x8x4x4xf32>) -> tensor<1x2x2x2xf32> attributes {kernel = "mixr"} {
%0 = migraphx.convolution(%arg1, %arg0) {dilation = [1, 1], group = 1 : i64, padding = [0, 0, 0, 0], padding_mode = 0 : i64, stride = [1, 1]
, use_dynamic_same_auto_pad = 0 : i64
} : (tensor<1x8x4x4xf32>, tensor<2x8x3x3xf32>) -> tensor<1x2x2x2xf32>
%0 = migraphx.convolution(%arg1, %arg0) {dilation = [1, 1], group = 1 : i64, padding = [0, 0, 0, 0], padding_mode = 0 : i64, stride = [1, 1]} : (tensor<1x8x4x4xf32>, tensor<2x8x3x3xf32>) -> tensor<1x2x2x2xf32>
return %0 : tensor<1x2x2x2xf32>
}
}
...
...
@@ -164,7 +164,7 @@ TEST_CASE(conv_add_relu)
const
std
::
string
mlir_output
=
R"__migraphx__(
module {
func.func @main(%arg0: tensor<1x2x2x2xf32>, %arg1: tensor<2x8x3x3xf32>, %arg2: tensor<1x8x4x4xf32>) -> tensor<1x2x2x2xf32> attributes {kernel = "mixr"} {
%0 = migraphx.convolution(%arg2, %arg1) {dilation = [1, 1], group = 1 : i64, padding = [0, 0, 0, 0], padding_mode = 0 : i64, stride = [1, 1]
, use_dynamic_same_auto_pad = 0 : i64
} : (tensor<1x8x4x4xf32>, tensor<2x8x3x3xf32>) -> tensor<1x2x2x2xf32>
%0 = migraphx.convolution(%arg2, %arg1) {dilation = [1, 1], group = 1 : i64, padding = [0, 0, 0, 0], padding_mode = 0 : i64, stride = [1, 1]} : (tensor<1x8x4x4xf32>, tensor<2x8x3x3xf32>) -> tensor<1x2x2x2xf32>
%1 = migraphx.add(%0, %arg0) : (tensor<1x2x2x2xf32>, tensor<1x2x2x2xf32>) -> tensor<1x2x2x2xf32>
%2 = migraphx.relu(%1) : (tensor<1x2x2x2xf32>) -> tensor<1x2x2x2xf32>
return %2 : tensor<1x2x2x2xf32>
...
...
test/gpu/quantization.cpp
View file @
15a7d96a
...
...
@@ -30,7 +30,6 @@
#include <migraphx/ref/target.hpp>
#include <migraphx/gpu/target.hpp>
#include <migraphx/verify.hpp>
#include <migraphx/quantization.hpp>
#include <migraphx/dead_code_elimination.hpp>
#include <migraphx/propagate_constant.hpp>
#include <migraphx/pass_manager.hpp>
...
...
test/layout_nhwc.cpp
0 → 100644
View file @
15a7d96a
/*
* The MIT License (MIT)
*
* Copyright (c) 2015-2022 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.
*/
#include <migraphx/layout_nhwc.hpp>
#include <migraphx/dead_code_elimination.hpp>
#include <migraphx/pass_manager.hpp>
#include <migraphx/operators.hpp>
#include <migraphx/generate.hpp>
#include <migraphx/ranges.hpp>
#include <migraphx/instruction.hpp>
#include <basic_ops.hpp>
#include <migraphx/make_op.hpp>
#include <test.hpp>
void
run_pass
(
migraphx
::
module
&
m
)
{
migraphx
::
run_passes
(
m
,
{
migraphx
::
layout_nhwc
{},
migraphx
::
dead_code_elimination
{}});
}
migraphx
::
operation
layout
(
std
::
vector
<
int64_t
>
permutation
=
{
0
,
1
,
2
,
3
})
{
return
migraphx
::
make_op
(
"layout"
,
{{
"permutation"
,
permutation
}});
}
migraphx
::
instruction_ref
add_layout_nhwc
(
migraphx
::
module
&
m
,
migraphx
::
instruction_ref
ins
)
{
return
m
.
add_instruction
(
layout
({
0
,
2
,
3
,
1
}),
ins
);
}
TEST_CASE
(
conv_relu
)
{
migraphx
::
module
m1
;
{
auto
x
=
m1
.
add_parameter
(
"x"
,
{
migraphx
::
shape
::
float_type
,
{
1
,
8
,
16
,
16
}});
auto
w
=
m1
.
add_literal
(
migraphx
::
generate_literal
({
migraphx
::
shape
::
float_type
,
{
16
,
8
,
3
,
3
}}));
auto
conv
=
m1
.
add_instruction
(
migraphx
::
make_op
(
"convolution"
,
{{
"padding"
,
{
1
,
1
}},
{
"stride"
,
{
2
,
2
}},
{
"dilation"
,
{
1
,
1
}}}),
x
,
w
);
m1
.
add_instruction
(
migraphx
::
make_op
(
"relu"
),
conv
);
}
run_pass
(
m1
);
migraphx
::
module
m2
;
{
auto
x
=
add_layout_nhwc
(
m2
,
m2
.
add_parameter
(
"x"
,
{
migraphx
::
shape
::
float_type
,
{
1
,
8
,
16
,
16
}}));
auto
w
=
add_layout_nhwc
(
m2
,
m2
.
add_literal
(
migraphx
::
generate_literal
(
{
migraphx
::
shape
::
float_type
,
{
16
,
8
,
3
,
3
}})));
auto
conv
=
m2
.
add_instruction
(
migraphx
::
make_op
(
"convolution"
,
{{
"padding"
,
{
1
,
1
}},
{
"stride"
,
{
2
,
2
}},
{
"dilation"
,
{
1
,
1
}}}),
x
,
w
);
auto
conv_layout
=
m2
.
add_instruction
(
layout
(),
conv
);
m2
.
add_instruction
(
migraphx
::
make_op
(
"relu"
),
conv_layout
);
}
EXPECT
(
m1
.
sort
()
==
m2
.
sort
());
}
TEST_CASE
(
conv_add
)
{
migraphx
::
module
m1
;
{
auto
x
=
m1
.
add_parameter
(
"x"
,
{
migraphx
::
shape
::
float_type
,
{
1
,
8
,
16
,
16
}});
auto
w
=
m1
.
add_literal
(
migraphx
::
generate_literal
({
migraphx
::
shape
::
float_type
,
{
16
,
8
,
3
,
3
}}));
auto
y
=
m1
.
add_literal
(
migraphx
::
generate_literal
({
migraphx
::
shape
::
float_type
,
{
16
}}));
auto
conv
=
m1
.
add_instruction
(
migraphx
::
make_op
(
"convolution"
,
{{
"padding"
,
{
1
,
1
}},
{
"stride"
,
{
2
,
2
}},
{
"dilation"
,
{
1
,
1
}}}),
x
,
w
);
auto
b
=
m1
.
add_instruction
(
migraphx
::
make_op
(
"broadcast"
,
{{
"axis"
,
1
},
{
"out_lens"
,
conv
->
get_shape
().
lens
()}}),
y
);
m1
.
add_instruction
(
migraphx
::
make_op
(
"add"
),
conv
,
b
);
}
run_pass
(
m1
);
migraphx
::
module
m2
;
{
auto
x
=
add_layout_nhwc
(
m2
,
m2
.
add_parameter
(
"x"
,
{
migraphx
::
shape
::
float_type
,
{
1
,
8
,
16
,
16
}}));
auto
w
=
add_layout_nhwc
(
m2
,
m2
.
add_literal
(
migraphx
::
generate_literal
(
{
migraphx
::
shape
::
float_type
,
{
16
,
8
,
3
,
3
}})));
auto
y
=
m2
.
add_literal
(
migraphx
::
generate_literal
({
migraphx
::
shape
::
float_type
,
{
16
}}));
auto
conv
=
m2
.
add_instruction
(
migraphx
::
make_op
(
"convolution"
,
{{
"padding"
,
{
1
,
1
}},
{
"stride"
,
{
2
,
2
}},
{
"dilation"
,
{
1
,
1
}}}),
x
,
w
);
auto
conv_layout
=
m2
.
add_instruction
(
layout
(),
conv
);
auto
b
=
m2
.
add_instruction
(
migraphx
::
make_op
(
"broadcast"
,
{{
"axis"
,
1
},
{
"out_lens"
,
conv
->
get_shape
().
lens
()}}),
y
);
m2
.
add_instruction
(
migraphx
::
make_op
(
"add"
),
conv_layout
,
b
);
}
EXPECT
(
m1
.
sort
()
==
m2
.
sort
());
}
int
main
(
int
argc
,
const
char
*
argv
[])
{
test
::
run
(
argc
,
argv
);
}
test/onnx/batch_norm_
invalid_
rank_test.onnx
→
test/onnx/batch_norm_rank_
2_
test.onnx
View file @
15a7d96a
batch_norm_
invalid_
rank_test:
7
batch_norm_rank_
2_
test:
J
x
scale
bias
mean
variancey"BatchNormalizationbatch_norm_invalid_rank_testZ
variancey"BatchNormalization*
epsilon75batch_norm_rank_2_testZ
x
Z
Z
scale
Z
Z
bias
Z
Z
mean
Z
Z
variance
b
b
y
B
\ No newline at end of file
B
\ No newline at end of file
test/onnx/binary_dyn_brcst_add_test.onnx
0 → 100644
View file @
15a7d96a
File added
test/onnx/binary_dyn_brcst_attr_error_test.onnx
0 → 100644
View file @
15a7d96a
File added
test/onnx/binary_dyn_brcst_mul_test.onnx
0 → 100644
View file @
15a7d96a
File added
test/onnx/binary_dyn_brcst_prelu_test.onnx
0 → 100644
View file @
15a7d96a
File added
test/onnx/gen_onnx.py
View file @
15a7d96a
...
...
@@ -331,6 +331,24 @@ def batch_norm_flat_test():
return
([
node
],
[
x
,
scale
,
bias
,
mean
,
var
],
[
out
])
@
onnx_test
def
batch_norm_rank_2_test
():
x
=
helper
.
make_tensor_value_info
(
'x'
,
TensorProto
.
FLOAT
,
[
2
,
5
])
scale
=
helper
.
make_tensor_value_info
(
'scale'
,
TensorProto
.
FLOAT
,
[
5
])
bias
=
helper
.
make_tensor_value_info
(
'bias'
,
TensorProto
.
FLOAT
,
[
5
])
mean
=
helper
.
make_tensor_value_info
(
'mean'
,
TensorProto
.
FLOAT
,
[
5
])
var
=
helper
.
make_tensor_value_info
(
'variance'
,
TensorProto
.
FLOAT
,
[
5
])
out
=
helper
.
make_tensor_value_info
(
'y'
,
TensorProto
.
FLOAT
,
[
2
,
5
])
node
=
onnx
.
helper
.
make_node
(
'BatchNormalization'
,
inputs
=
[
'x'
,
'scale'
,
'bias'
,
'mean'
,
'variance'
],
outputs
=
[
'y'
],
epsilon
=
1e-6
)
return
([
node
],
[
x
,
scale
,
bias
,
mean
,
var
],
[
out
])
@
onnx_test
def
batch_norm_1d_test
():
x
=
helper
.
make_tensor_value_info
(
'x'
,
TensorProto
.
FLOAT16
,
[
2
,
3
,
4
])
...
...
@@ -385,23 +403,6 @@ def batch_norm_3d_test():
return
([
node
],
[
x
,
scale
,
bias
,
mean
,
var
],
[
out
])
@
onnx_test
def
batch_norm_invalid_rank_test
():
x
=
helper
.
make_tensor_value_info
(
'x'
,
TensorProto
.
FLOAT
,
[
8
,
8
])
scale
=
helper
.
make_tensor_value_info
(
'scale'
,
TensorProto
.
FLOAT
,
[
8
])
bias
=
helper
.
make_tensor_value_info
(
'bias'
,
TensorProto
.
FLOAT
,
[
8
])
mean
=
helper
.
make_tensor_value_info
(
'mean'
,
TensorProto
.
FLOAT
,
[
8
])
var
=
helper
.
make_tensor_value_info
(
'variance'
,
TensorProto
.
FLOAT
,
[
8
])
out
=
helper
.
make_tensor_value_info
(
'y'
,
TensorProto
.
FLOAT
,
[
8
,
8
])
node
=
onnx
.
helper
.
make_node
(
'BatchNormalization'
,
inputs
=
[
'x'
,
'scale'
,
'bias'
,
'mean'
,
'variance'
],
outputs
=
[
'y'
])
return
([
node
],
[
x
,
scale
,
bias
,
mean
,
var
],
[
out
])
@
onnx_test
def
batch_norm_invalid_bias_rank_test
():
x
=
helper
.
make_tensor_value_info
(
'x'
,
TensorProto
.
FLOAT
,
[
2
,
3
,
4
,
4
])
...
...
@@ -419,6 +420,74 @@ def batch_norm_invalid_bias_rank_test():
return
([
node
],
[
x
,
scale
,
bias
,
mean
,
var
],
[
out
])
@
onnx_test
def
binary_dyn_brcst_prelu_test
():
arg0
=
helper
.
make_tensor_value_info
(
'0'
,
TensorProto
.
FLOAT
,
[
None
,
3
,
4
,
5
])
arg1
=
helper
.
make_tensor_value_info
(
'1'
,
TensorProto
.
FLOAT
,
[
4
,
5
])
arg_out
=
helper
.
make_tensor_value_info
(
'out'
,
TensorProto
.
FLOAT
,
[
None
,
3
,
4
,
5
])
node
=
onnx
.
helper
.
make_node
(
'PRelu'
,
inputs
=
[
'0'
,
'1'
],
outputs
=
[
'out'
],
)
return
([
node
],
[
arg0
,
arg1
],
[
arg_out
])
@
onnx_test
def
binary_dyn_brcst_add_test
():
arg0
=
helper
.
make_tensor_value_info
(
'0'
,
TensorProto
.
FLOAT16
,
[
4
,
5
])
arg1
=
helper
.
make_tensor_value_info
(
'1'
,
TensorProto
.
FLOAT
,
[
None
,
3
,
4
,
5
])
arg_out
=
helper
.
make_tensor_value_info
(
'out'
,
TensorProto
.
FLOAT
,
[
None
,
3
,
4
,
5
])
node
=
onnx
.
helper
.
make_node
(
'Add'
,
inputs
=
[
'0'
,
'1'
],
outputs
=
[
'out'
],
)
return
([
node
],
[
arg0
,
arg1
],
[
arg_out
])
@
onnx_test
def
binary_dyn_brcst_attr_error_test
():
arg0
=
helper
.
make_tensor_value_info
(
'0'
,
TensorProto
.
FLOAT16
,
[
4
,
5
])
arg1
=
helper
.
make_tensor_value_info
(
'1'
,
TensorProto
.
FLOAT
,
[
None
,
3
,
4
,
5
])
arg_out
=
helper
.
make_tensor_value_info
(
'out'
,
TensorProto
.
FLOAT
,
[
None
,
3
,
4
,
5
])
node
=
onnx
.
helper
.
make_node
(
'Add'
,
inputs
=
[
'0'
,
'1'
],
outputs
=
[
'out'
],
broadcast
=
1
,
axis
=
1
)
return
([
node
],
[
arg0
,
arg1
],
[
arg_out
])
@
onnx_test
def
binary_dyn_brcst_mul_test
():
arg0
=
helper
.
make_tensor_value_info
(
'0'
,
TensorProto
.
FLOAT
,
[
None
,
3
,
4
,
5
])
arg1
=
helper
.
make_tensor_value_info
(
'1'
,
TensorProto
.
FLOAT
,
[
4
,
1
])
arg_out
=
helper
.
make_tensor_value_info
(
'out'
,
TensorProto
.
FLOAT
,
[
None
,
3
,
4
,
5
])
node
=
onnx
.
helper
.
make_node
(
'Mul'
,
inputs
=
[
'0'
,
'1'
],
outputs
=
[
'out'
],
)
return
([
node
],
[
arg0
,
arg1
],
[
arg_out
])
@
onnx_test
def
cast_test
():
x
=
helper
.
make_tensor_value_info
(
'x'
,
TensorProto
.
FLOAT16
,
[
10
])
...
...
@@ -3647,6 +3716,16 @@ def neg_test():
return
([
node
],
[
x
],
[
y
])
@
onnx_test
def
neg_dynamic_test
():
x
=
helper
.
make_tensor_value_info
(
'0'
,
TensorProto
.
INT64
,
[
None
,
3
])
y
=
helper
.
make_tensor_value_info
(
'1'
,
TensorProto
.
INT64
,
[
None
,
3
])
node
=
onnx
.
helper
.
make_node
(
'Neg'
,
inputs
=
[
'0'
],
outputs
=
[
'1'
])
return
([
node
],
[
x
],
[
y
])
@
onnx_test
def
nms_test
():
b
=
helper
.
make_tensor_value_info
(
'boxes'
,
TensorProto
.
FLOAT
,
[
1
,
6
,
4
])
...
...
@@ -5280,6 +5359,20 @@ def sinh_test():
return
([
node
],
[
x
],
[
y
])
@
onnx_test
def
sinh_dynamic_test
():
x
=
helper
.
make_tensor_value_info
(
'x'
,
TensorProto
.
FLOAT
,
[
None
])
y
=
helper
.
make_tensor_value_info
(
'y'
,
TensorProto
.
FLOAT
,
[
None
])
node
=
onnx
.
helper
.
make_node
(
'Sinh'
,
inputs
=
[
'x'
],
outputs
=
[
'y'
],
)
return
([
node
],
[
x
],
[
y
])
@
onnx_test
def
size_float_test
():
x
=
helper
.
make_tensor_value_info
(
'x'
,
TensorProto
.
FLOAT
,
[
2
,
3
,
4
])
...
...
@@ -5662,6 +5755,92 @@ def split_test_default():
return
([
node
],
[
x
],
[
y1
,
y2
])
@
onnx_test
def
split_test_no_attribute
():
x
=
helper
.
make_tensor_value_info
(
'x'
,
TensorProto
.
FLOAT
,
[
300
,
15
])
y1
=
helper
.
make_tensor_value_info
(
'y1'
,
TensorProto
.
FLOAT
,
[
75
,
15
])
y2
=
helper
.
make_tensor_value_info
(
'y2'
,
TensorProto
.
FLOAT
,
[
75
,
15
])
y3
=
helper
.
make_tensor_value_info
(
'y3'
,
TensorProto
.
FLOAT
,
[
75
,
15
])
y4
=
helper
.
make_tensor_value_info
(
'y4'
,
TensorProto
.
FLOAT
,
[
75
,
15
])
split
=
np
.
ones
(
4
)
*
75
split_tensor
=
helper
.
make_tensor
(
name
=
"split"
,
data_type
=
TensorProto
.
INT64
,
dims
=
split
.
shape
,
vals
=
split
.
astype
(
np
.
int64
))
const_node
=
helper
.
make_node
(
"Constant"
,
inputs
=
[],
outputs
=
[
'split'
],
value
=
split_tensor
)
node
=
onnx
.
helper
.
make_node
(
'Split'
,
inputs
=
[
'x'
,
'split'
],
outputs
=
[
'y1'
,
'y2'
,
'y3'
,
'y4'
],
)
return
([
const_node
,
node
],
[
x
],
[
y1
,
y2
,
y3
,
y4
])
@
onnx_test
def
split_test_no_attribute_invalid_split
():
x
=
helper
.
make_tensor_value_info
(
'x'
,
TensorProto
.
FLOAT
,
[
300
,
15
])
y1
=
helper
.
make_tensor_value_info
(
'y1'
,
TensorProto
.
FLOAT
,
[
75
,
15
])
y2
=
helper
.
make_tensor_value_info
(
'y2'
,
TensorProto
.
FLOAT
,
[
75
,
15
])
y3
=
helper
.
make_tensor_value_info
(
'y3'
,
TensorProto
.
FLOAT
,
[
75
,
15
])
y4
=
helper
.
make_tensor_value_info
(
'y4'
,
TensorProto
.
FLOAT
,
[
75
,
15
])
split
=
np
.
ones
(
4
)
split_tensor
=
helper
.
make_tensor
(
name
=
"split"
,
data_type
=
TensorProto
.
INT64
,
dims
=
split
.
shape
,
vals
=
split
.
astype
(
np
.
int64
))
const_node
=
helper
.
make_node
(
"Constant"
,
inputs
=
[],
outputs
=
[
'split'
],
value
=
split_tensor
)
node
=
onnx
.
helper
.
make_node
(
'Split'
,
inputs
=
[
'x'
,
'split'
],
outputs
=
[
'y1'
,
'y2'
,
'y3'
,
'y4'
],
)
return
([
const_node
,
node
],
[
x
],
[
y1
,
y2
,
y3
,
y4
])
@
onnx_test
def
split_test_invalid_split
():
x
=
helper
.
make_tensor_value_info
(
'x'
,
TensorProto
.
FLOAT
,
[
10
,
15
])
y1
=
helper
.
make_tensor_value_info
(
'y1'
,
TensorProto
.
FLOAT
,
[
10
,
7
])
y2
=
helper
.
make_tensor_value_info
(
'y2'
,
TensorProto
.
FLOAT
,
[
10
,
4
])
y3
=
helper
.
make_tensor_value_info
(
'y3'
,
TensorProto
.
FLOAT
,
[
10
,
4
])
node
=
onnx
.
helper
.
make_node
(
'Split'
,
inputs
=
[
'x'
],
outputs
=
[
'y1'
,
'y2'
,
'y3'
],
axis
=
1
,
split
=
[
1
,
1
,
1
])
return
([
node
],
[
x
],
[
y1
,
y2
,
y3
])
@
onnx_test
def
split_test_no_attribute_invalid_input_split
():
x
=
helper
.
make_tensor_value_info
(
'x'
,
TensorProto
.
FLOAT
,
[
10
,
15
])
y1
=
helper
.
make_tensor_value_info
(
'y1'
,
TensorProto
.
FLOAT
,
[
10
,
7
])
y2
=
helper
.
make_tensor_value_info
(
'y2'
,
TensorProto
.
FLOAT
,
[
10
,
4
])
y3
=
helper
.
make_tensor_value_info
(
'y3'
,
TensorProto
.
FLOAT
,
[
10
,
4
])
node
=
onnx
.
helper
.
make_node
(
'Split'
,
inputs
=
[
'x'
],
outputs
=
[
'y1'
,
'y2'
,
'y3'
],
axis
=
1
,
split
=
[])
return
([
node
],
[
x
],
[
y1
,
y2
,
y3
])
@
onnx_test
def
sqrt_test
():
x
=
helper
.
make_tensor_value_info
(
'x'
,
TensorProto
.
FLOAT
,
[
10
,
15
])
...
...
test/onnx/neg_dynamic_test.onnx
0 → 100644
View file @
15a7d96a
File added
test/onnx/onnx_test.cpp
View file @
15a7d96a
...
...
@@ -42,7 +42,6 @@
#include <migraphx/op/lrn.hpp>
#include <migraphx/op/reshape.hpp>
#include <migraphx/op/unknown.hpp>
#include <random>
#include <migraphx/serialize.hpp>
...
...
@@ -394,6 +393,31 @@ TEST_CASE(batch_norm_flat_test)
EXPECT
(
p
==
prog
);
}
TEST_CASE
(
batch_norm_rank_2_test
)
{
migraphx
::
program
p
;
auto
*
mm
=
p
.
get_main_module
();
auto
x
=
mm
->
add_parameter
(
"x"
,
{
migraphx
::
shape
::
float_type
,
{
2
,
5
}});
auto
scale
=
mm
->
add_parameter
(
"scale"
,
{
migraphx
::
shape
::
float_type
,
{
5
}});
auto
bias
=
mm
->
add_parameter
(
"bias"
,
{
migraphx
::
shape
::
float_type
,
{
5
}});
auto
mean
=
mm
->
add_parameter
(
"mean"
,
{
migraphx
::
shape
::
float_type
,
{
5
}});
auto
var
=
mm
->
add_parameter
(
"variance"
,
{
migraphx
::
shape
::
float_type
,
{
5
}});
auto
rt
=
mm
->
add_literal
(
migraphx
::
literal
{
migraphx
::
shape
::
float_type
,
{
0.5
}});
auto
eps
=
mm
->
add_literal
(
migraphx
::
literal
{
migraphx
::
shape
::
float_type
,
{
1e-6
f
}});
auto
numer
=
add_common_op
(
*
mm
,
migraphx
::
make_op
(
"sub"
),
{
x
,
mean
});
auto
var_eps
=
add_common_op
(
*
mm
,
migraphx
::
make_op
(
"add"
),
{
var
,
eps
});
auto
denom
=
add_common_op
(
*
mm
,
migraphx
::
make_op
(
"pow"
),
{
var_eps
,
rt
});
auto
div0
=
add_common_op
(
*
mm
,
migraphx
::
make_op
(
"div"
),
{
numer
,
denom
});
auto
r0
=
add_common_op
(
*
mm
,
migraphx
::
make_op
(
"mul"
),
{
div0
,
scale
});
add_common_op
(
*
mm
,
migraphx
::
make_op
(
"add"
),
{
r0
,
bias
});
auto
prog
=
optimize_onnx
(
"batch_norm_rank_2_test.onnx"
);
EXPECT
(
p
==
prog
);
}
TEST_CASE
(
batch_norm_1d_test
)
{
migraphx
::
program
p
;
...
...
@@ -497,6 +521,76 @@ TEST_CASE(batch_norm_invalid_bias_rank)
EXPECT
(
test
::
throws
([
&
]
{
migraphx
::
parse_onnx
(
"batch_norm_invalid_bias_rank.onnx"
);
}));
}
TEST_CASE
(
binary_dyn_brcst_prelu_test
)
{
migraphx
::
program
p
;
auto
*
mm
=
p
.
get_main_module
();
auto
l0
=
mm
->
add_parameter
(
"0"
,
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
{{
1
,
4
,
0
},
{
3
,
3
,
0
},
{
4
,
4
,
0
},
{
5
,
5
,
0
}}});
auto
l1
=
mm
->
add_parameter
(
"1"
,
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
{
4
,
5
}});
auto
ret
=
add_common_op
(
*
mm
,
migraphx
::
make_op
(
"prelu"
),
{
l0
,
l1
});
mm
->
add_return
({
ret
});
migraphx
::
onnx_options
options
;
options
.
default_dyn_dim_value
=
{
1
,
4
,
0
};
auto
prog
=
migraphx
::
parse_onnx
(
"binary_dyn_brcst_prelu_test.onnx"
,
options
);
EXPECT
(
p
==
prog
);
}
TEST_CASE
(
binary_dyn_brcst_add_test
)
{
migraphx
::
program
p
;
auto
*
mm
=
p
.
get_main_module
();
auto
l0
=
mm
->
add_parameter
(
"0"
,
migraphx
::
shape
{
migraphx
::
shape
::
half_type
,
{
4
,
5
}});
auto
l1
=
mm
->
add_parameter
(
"1"
,
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
{{
1
,
4
,
0
},
{
3
,
3
,
0
},
{
4
,
4
,
0
},
{
5
,
5
,
0
}}});
auto
ret
=
add_common_op
(
*
mm
,
migraphx
::
make_op
(
"add"
),
{
l0
,
l1
});
mm
->
add_return
({
ret
});
migraphx
::
onnx_options
options
;
options
.
default_dyn_dim_value
=
{
1
,
4
,
0
};
auto
prog
=
migraphx
::
parse_onnx
(
"binary_dyn_brcst_add_test.onnx"
,
options
);
EXPECT
(
p
==
prog
);
}
TEST_CASE
(
binary_dyn_brcst_attr_error_test
)
{
migraphx
::
onnx_options
options
;
options
.
default_dyn_dim_value
=
{
1
,
4
,
0
};
EXPECT
(
test
::
throws
(
[
&
]
{
migraphx
::
parse_onnx
(
"binary_dyn_brcst_attr_error_test.onnx"
,
options
);
}));
}
TEST_CASE
(
binary_dyn_brcst_mul_test
)
{
migraphx
::
program
p
;
auto
*
mm
=
p
.
get_main_module
();
auto
l0
=
mm
->
add_parameter
(
"0"
,
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
{{
1
,
4
,
0
},
{
3
,
3
,
0
},
{
4
,
4
,
0
},
{
5
,
5
,
0
}}});
auto
l1
=
mm
->
add_parameter
(
"1"
,
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
{
4
,
1
}});
auto
bl1
=
mm
->
add_instruction
(
migraphx
::
make_op
(
"multibroadcast"
,
{{
"out_dyn_dims"
,
to_value
(
l0
->
get_shape
().
dyn_dims
())}}),
l1
,
l0
);
auto
ret
=
mm
->
add_instruction
(
migraphx
::
make_op
(
"mul"
),
l0
,
bl1
);
mm
->
add_return
({
ret
});
migraphx
::
onnx_options
options
;
options
.
default_dyn_dim_value
=
{
1
,
4
,
0
};
auto
prog
=
migraphx
::
parse_onnx
(
"binary_dyn_brcst_mul_test.onnx"
,
options
);
EXPECT
(
p
==
prog
);
}
TEST_CASE
(
cast_test
)
{
migraphx
::
program
p
;
...
...
@@ -856,8 +950,7 @@ TEST_CASE(conv_autopad_same_test)
auto
l0
=
mm
->
add_parameter
(
"0"
,
{
migraphx
::
shape
::
float_type
,
{
1
,
3
,
32
,
32
}});
auto
l1
=
mm
->
add_parameter
(
"1"
,
{
migraphx
::
shape
::
float_type
,
{
1
,
3
,
3
,
3
}});
migraphx
::
op
::
convolution
op
;
op
.
padding
=
{
1
,
1
,
1
,
1
};
op
.
padding_mode
=
migraphx
::
op
::
padding_mode_t
::
same
;
op
.
padding
=
{
1
,
1
,
1
,
1
};
mm
->
add_instruction
(
op
,
l0
,
l1
);
auto
prog
=
optimize_onnx
(
"conv_autopad_same_test.onnx"
);
...
...
@@ -1034,15 +1127,11 @@ TEST_CASE(conv_dynamic_batch_same_upper)
auto
l0
=
mm
->
add_parameter
(
"0"
,
{
migraphx
::
shape
::
float_type
,
{{
1
,
10
,
0
},
{
3
,
3
,
0
},
{
5
,
5
,
0
},
{
5
,
5
,
0
}}});
auto
l1
=
mm
->
add_parameter
(
"1"
,
{
migraphx
::
shape
::
float_type
,
{
1
,
3
,
3
,
3
}});
auto
c0
=
mm
->
add_instruction
(
migraphx
::
make_op
(
"convolution"
,
{{
"padding"
,
{
1
,
1
,
1
,
1
}},
{
"stride"
,
{
1
,
1
}},
{
"dilation"
,
{
1
,
1
}},
{
"padding_mode"
,
migraphx
::
op
::
padding_mode_t
::
same
},
{
"use_dynamic_same_auto_pad"
,
false
}}),
l0
,
l1
);
auto
c0
=
mm
->
add_instruction
(
migraphx
::
make_op
(
"convolution"
,
{{
"padding"
,
{
1
,
1
,
1
,
1
}},
{
"stride"
,
{
1
,
1
}},
{
"dilation"
,
{
1
,
1
}}}),
l0
,
l1
);
mm
->
add_return
({
c0
});
migraphx
::
onnx_options
options
;
...
...
@@ -1064,8 +1153,7 @@ TEST_CASE(conv_dynamic_img_same_upper)
{{
"padding"
,
{
0
,
0
}},
{
"stride"
,
{
1
,
1
}},
{
"dilation"
,
{
1
,
1
}},
{
"padding_mode"
,
migraphx
::
op
::
padding_mode_t
::
same_upper
},
{
"use_dynamic_same_auto_pad"
,
true
}}),
{
"padding_mode"
,
migraphx
::
op
::
padding_mode_t
::
same_upper
}}),
l0
,
l1
);
mm
->
add_return
({
c0
});
...
...
@@ -1089,8 +1177,7 @@ TEST_CASE(conv_dynamic_kernel_same_lower)
{{
"padding"
,
{
0
,
0
}},
{
"stride"
,
{
1
,
1
}},
{
"dilation"
,
{
1
,
1
}},
{
"padding_mode"
,
migraphx
::
op
::
padding_mode_t
::
same_lower
},
{
"use_dynamic_same_auto_pad"
,
true
}}),
{
"padding_mode"
,
migraphx
::
op
::
padding_mode_t
::
same_lower
}}),
l0
,
l1
);
mm
->
add_return
({
c0
});
...
...
@@ -3483,6 +3570,21 @@ TEST_CASE(neg_test)
EXPECT
(
p
==
prog
);
}
TEST_CASE
(
neg_dynamic_test
)
{
migraphx
::
program
p
;
auto
*
mm
=
p
.
get_main_module
();
migraphx
::
shape
s
{
migraphx
::
shape
::
int64_type
,
{{
1
,
10
,
0
},
{
3
,
3
,
0
}}};
auto
input
=
mm
->
add_parameter
(
"0"
,
s
);
auto
ret
=
mm
->
add_instruction
(
migraphx
::
make_op
(
"neg"
),
input
);
mm
->
add_return
({
ret
});
migraphx
::
onnx_options
options
;
options
.
default_dyn_dim_value
=
{
1
,
10
,
0
};
auto
prog
=
migraphx
::
parse_onnx
(
"neg_dynamic_test.onnx"
,
options
);
EXPECT
(
p
==
prog
);
}
TEST_CASE
(
nms_test
)
{
migraphx
::
program
p
;
...
...
@@ -5206,6 +5308,24 @@ TEST_CASE(sinh_test)
EXPECT
(
p
==
prog
);
}
TEST_CASE
(
sinh_dynamic_test
)
{
migraphx
::
program
p
;
auto
*
mm
=
p
.
get_main_module
();
migraphx
::
shape
::
dynamic_dimension
dd
{
1
,
10
,
0
};
std
::
vector
<
migraphx
::
shape
::
dynamic_dimension
>
dyn_dims
;
dyn_dims
.
push_back
(
dd
);
auto
input
=
mm
->
add_parameter
(
"x"
,
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
dyn_dims
});
auto
ret
=
mm
->
add_instruction
(
migraphx
::
make_op
(
"sinh"
),
input
);
mm
->
add_return
({
ret
});
migraphx
::
onnx_options
options
;
options
.
default_dyn_dim_value
=
dd
;
auto
prog
=
parse_onnx
(
"sinh_dynamic_test.onnx"
,
options
);
EXPECT
(
p
==
prog
);
}
TEST_CASE
(
size_float_test
)
{
migraphx
::
program
p
;
...
...
@@ -5487,6 +5607,31 @@ TEST_CASE(split_test)
EXPECT
(
p
==
prog
);
}
TEST_CASE
(
split_test_no_attribute
)
{
migraphx
::
program
p
;
auto
*
mm
=
p
.
get_main_module
();
migraphx
::
shape
si
{
migraphx
::
shape
::
int64_type
,
{
4
},
{
1
}};
std
::
vector
<
int
>
ind
=
{
75
,
75
,
75
,
75
};
auto
input
=
mm
->
add_parameter
(
"x"
,
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
{
300
,
15
}});
mm
->
add_literal
(
migraphx
::
literal
(
si
,
ind
));
auto
r1
=
mm
->
add_instruction
(
migraphx
::
make_op
(
"slice"
,
{{
"axes"
,
{
0
}},
{
"starts"
,
{
0
}},
{
"ends"
,
{
75
}}}),
input
);
auto
r2
=
mm
->
add_instruction
(
migraphx
::
make_op
(
"slice"
,
{{
"axes"
,
{
0
}},
{
"starts"
,
{
75
}},
{
"ends"
,
{
150
}}}),
input
);
auto
r3
=
mm
->
add_instruction
(
migraphx
::
make_op
(
"slice"
,
{{
"axes"
,
{
0
}},
{
"starts"
,
{
150
}},
{
"ends"
,
{
225
}}}),
input
);
auto
r4
=
mm
->
add_instruction
(
migraphx
::
make_op
(
"slice"
,
{{
"axes"
,
{
0
}},
{
"starts"
,
{
225
}},
{
"ends"
,
{
300
}}}),
input
);
mm
->
add_return
({
r1
,
r2
,
r3
,
r4
});
auto
prog
=
migraphx
::
parse_onnx
(
"split_test_no_attribute.onnx"
);
EXPECT
(
p
==
prog
);
}
TEST_CASE
(
split_test_default
)
{
migraphx
::
program
p
;
...
...
@@ -5502,6 +5647,23 @@ TEST_CASE(split_test_default)
EXPECT
(
p
==
prog
);
}
TEST_CASE
(
split_test_no_attribute_invalid_split
)
{
EXPECT
(
test
::
throws
([
&
]
{
migraphx
::
parse_onnx
(
"split_test_no_attribute_invalid_split.onnx"
);
}));
}
TEST_CASE
(
split_test_invalid_split
)
{
EXPECT
(
test
::
throws
([
&
]
{
migraphx
::
parse_onnx
(
"split_test_invalid_split.onnx"
);
}));
}
TEST_CASE
(
split_test_no_attribute_invalid_input_split
)
{
EXPECT
(
test
::
throws
(
[
&
]
{
migraphx
::
parse_onnx
(
"split_test_no_attribute_invalid_input_split.onnx"
);
}));
}
TEST_CASE
(
sqrt_test
)
{
migraphx
::
program
p
;
...
...
test/onnx/sinh_dynamic_test.onnx
0 → 100644
View file @
15a7d96a
File added
test/onnx/split_test_invalid_split.onnx
0 → 100644
View file @
15a7d96a
split_test_invalid_split:
5
xy1y2y3"Split*
axis*
split@@@split_test_invalid_splitZ
x
b
y1
b
y2
b
y3
B
\ No newline at end of file
test/onnx/split_test_no_attribute.onnx
0 → 100644
View file @
15a7d96a
split_test_no_attribute:
0split"Constant*
value*:KKKKBsplit
!
x
splity1y2y3y4"Splitsplit_test_no_attributeZ
x
b
y1
K
b
y2
K
b
y3
K
b
y4
K
B
\ No newline at end of file
test/onnx/split_test_no_attribute_invalid_input_split.onnx
0 → 100644
View file @
15a7d96a
+split_test_no_attribute_invalid_input_split:
/
xy1y2y3"Split*
axis*
split+split_test_no_attribute_invalid_input_splitZ
x
b
y1
b
y2
b
y3
B
\ No newline at end of file
Prev
1
2
3
4
5
6
7
8
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