This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1452,6 +1452,85 @@ def slice_large_channel_1024():
|
||||
save_model(model, "slice/large_channel_1024", "slice_large_channel_1024.onnx")
|
||||
|
||||
|
||||
def slice_nonzero_channel_offset_add():
|
||||
"""Add two channel slices where one operand starts at a non-zero channel offset."""
|
||||
X = helper.make_tensor_value_info("X", TensorProto.FLOAT, [1, 4, 16])
|
||||
Y = helper.make_tensor_value_info("Y", TensorProto.FLOAT, [1, 2, 16])
|
||||
starts0 = make_int64_initializer("starts0", [0])
|
||||
ends0 = make_int64_initializer("ends0", [2])
|
||||
starts1 = make_int64_initializer("starts1", [2])
|
||||
ends1 = make_int64_initializer("ends1", [4])
|
||||
axes = make_int64_initializer("axes", [1])
|
||||
slice0 = helper.make_node("Slice", ["X", "starts0", "ends0", "axes"], ["S0"])
|
||||
slice1 = helper.make_node("Slice", ["X", "starts1", "ends1", "axes"], ["S1"])
|
||||
add = helper.make_node("Add", ["S0", "S1"], ["Y"])
|
||||
graph = helper.make_graph(
|
||||
[slice0, slice1, add], "slice_nonzero_channel_offset_add", [X], [Y],
|
||||
initializer=[starts0, ends0, starts1, ends1, axes])
|
||||
model = helper.make_model(graph, opset_imports=[helper.make_opsetid("", 13)])
|
||||
save_model(model, "slice/nonzero_channel_offset_add", "slice_nonzero_channel_offset_add.onnx")
|
||||
|
||||
|
||||
def slice_nonzero_channel_offset_sub():
|
||||
"""Sub two channel slices where one operand starts at a non-zero channel offset."""
|
||||
X = helper.make_tensor_value_info("X", TensorProto.FLOAT, [1, 4, 16])
|
||||
Y = helper.make_tensor_value_info("Y", TensorProto.FLOAT, [1, 2, 16])
|
||||
starts0 = make_int64_initializer("starts0", [0])
|
||||
ends0 = make_int64_initializer("ends0", [2])
|
||||
starts1 = make_int64_initializer("starts1", [2])
|
||||
ends1 = make_int64_initializer("ends1", [4])
|
||||
axes = make_int64_initializer("axes", [1])
|
||||
slice0 = helper.make_node("Slice", ["X", "starts0", "ends0", "axes"], ["S0"])
|
||||
slice1 = helper.make_node("Slice", ["X", "starts1", "ends1", "axes"], ["S1"])
|
||||
sub = helper.make_node("Sub", ["S0", "S1"], ["Y"])
|
||||
graph = helper.make_graph(
|
||||
[slice0, slice1, sub], "slice_nonzero_channel_offset_sub", [X], [Y],
|
||||
initializer=[starts0, ends0, starts1, ends1, axes])
|
||||
model = helper.make_model(graph, opset_imports=[helper.make_opsetid("", 13)])
|
||||
save_model(model, "slice/nonzero_channel_offset_sub", "slice_nonzero_channel_offset_sub.onnx")
|
||||
|
||||
|
||||
def slice_nonzero_channel_offset_mul():
|
||||
"""Mul two channel slices where one operand starts at a non-zero channel offset."""
|
||||
X = helper.make_tensor_value_info("X", TensorProto.FLOAT, [1, 4, 16])
|
||||
Y = helper.make_tensor_value_info("Y", TensorProto.FLOAT, [1, 2, 16])
|
||||
starts0 = make_int64_initializer("starts0", [0])
|
||||
ends0 = make_int64_initializer("ends0", [2])
|
||||
starts1 = make_int64_initializer("starts1", [2])
|
||||
ends1 = make_int64_initializer("ends1", [4])
|
||||
axes = make_int64_initializer("axes", [1])
|
||||
slice0 = helper.make_node("Slice", ["X", "starts0", "ends0", "axes"], ["S0"])
|
||||
slice1 = helper.make_node("Slice", ["X", "starts1", "ends1", "axes"], ["S1"])
|
||||
mul = helper.make_node("Mul", ["S0", "S1"], ["Y"])
|
||||
graph = helper.make_graph(
|
||||
[slice0, slice1, mul], "slice_nonzero_channel_offset_mul", [X], [Y],
|
||||
initializer=[starts0, ends0, starts1, ends1, axes])
|
||||
model = helper.make_model(graph, opset_imports=[helper.make_opsetid("", 13)])
|
||||
save_model(model, "slice/nonzero_channel_offset_mul", "slice_nonzero_channel_offset_mul.onnx")
|
||||
|
||||
|
||||
def slice_yolo_like_decode_tail():
|
||||
"""YOLO-like decode tail using two channel slices with a non-zero-offset slice feeding Sub/Add/Sub/Concat."""
|
||||
X = helper.make_tensor_value_info("X", TensorProto.FLOAT, [1, 4, 16])
|
||||
Y = helper.make_tensor_value_info("Y", TensorProto.FLOAT, [1, 4, 16])
|
||||
starts0 = make_int64_initializer("starts0", [0])
|
||||
ends0 = make_int64_initializer("ends0", [2])
|
||||
starts1 = make_int64_initializer("starts1", [2])
|
||||
ends1 = make_int64_initializer("ends1", [4])
|
||||
axes = make_int64_initializer("axes", [1])
|
||||
slice0 = helper.make_node("Slice", ["X", "starts0", "ends0", "axes"], ["S0"])
|
||||
slice1 = helper.make_node("Slice", ["X", "starts1", "ends1", "axes"], ["S1"])
|
||||
sub0 = helper.make_node("Sub", ["S1", "S0"], ["D0"])
|
||||
add0 = helper.make_node("Add", ["S0", "S1"], ["A0"])
|
||||
sub1 = helper.make_node("Sub", ["A0", "D0"], ["D1"])
|
||||
concat = helper.make_node("Concat", ["D0", "D1"], ["Y"], axis=1)
|
||||
graph = helper.make_graph(
|
||||
[slice0, slice1, sub0, add0, sub1, concat], "slice_yolo_like_decode_tail", [X], [Y],
|
||||
initializer=[starts0, ends0, starts1, ends1, axes])
|
||||
model = helper.make_model(graph, opset_imports=[helper.make_opsetid("", 13)])
|
||||
save_model(model, "slice/yolo_like_decode_tail", "slice_yolo_like_decode_tail.onnx")
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Gather tests
|
||||
# ---------------------------------------------------------------------------
|
||||
@@ -2001,6 +2080,10 @@ if __name__ == "__main__":
|
||||
slice_nchw_spatial_crop()
|
||||
slice_after_conv()
|
||||
slice_large_channel_1024()
|
||||
slice_nonzero_channel_offset_add()
|
||||
slice_nonzero_channel_offset_sub()
|
||||
slice_nonzero_channel_offset_mul()
|
||||
slice_yolo_like_decode_tail()
|
||||
|
||||
print("\nGenerating Softmax tests:")
|
||||
softmax_basic()
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user