Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert ONNX models during import and run import in parallel. #90

Merged
merged 4 commits into from
Mar 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 5 additions & 1 deletion iree_tests/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# TODO(scotttodd): compile into a build/temp dir instead of the source dir
*.vmfb
# TODO(scotttodd): compile into a build dir instead of the source dir
# TODO(scotttodd): convert into a build/temp dir instead of the source dir
*.onnx

# Leftovers from an older iteration of compile/run test scripts.
config_*.txt
16 changes: 1 addition & 15 deletions iree_tests/configs/config_cpu_llvm_sync.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
"test_dequantizelinear",
"test_slice_default_axes",
],
"skip_run_tests": [
],
"skip_run_tests": [],
"expected_compile_failures": [
"test_acos_example",
"test_acos",
Expand Down Expand Up @@ -134,7 +133,6 @@
"test_castlike_FLOAT8E5M2FNUZ_to_FLOAT",
"test_castlike_STRING_to_FLOAT_expanded",
"test_castlike_STRING_to_FLOAT",
"test_celu_expanded",
"test_celu",
"test_center_crop_pad_crop_and_pad_expanded",
"test_center_crop_pad_crop_and_pad",
Expand All @@ -148,9 +146,7 @@
"test_center_crop_pad_crop",
"test_center_crop_pad_pad_expanded",
"test_center_crop_pad_pad",
"test_clip_default_inbounds_expanded",
"test_clip_default_inbounds",
"test_clip_default_int8_inbounds_expanded",
"test_clip_default_int8_inbounds",
"test_clip_default_int8_max",
"test_clip_default_max",
Expand Down Expand Up @@ -231,8 +227,6 @@
"test_gemm_default_no_bias",
"test_globalmaxpool_precomputed",
"test_globalmaxpool",
"test_greater_bcast",
"test_greater",
"test_gridsample_aligncorners_true",
"test_gridsample_bicubic_align_corners_0_additional_1",
"test_gridsample_bicubic_align_corners_1_additional_1",
Expand Down Expand Up @@ -371,7 +365,6 @@
"test_mod_uint8",
"test_momentum_multiple",
"test_momentum",
"test_mvn_expanded",
"test_mvn",
"test_nesterov_momentum",
"test_nllloss_NC",
Expand Down Expand Up @@ -711,13 +704,6 @@
"test_slice_negative_axes",
"test_slice_start_out_of_bounds",
"test_slice",
"test_softmax_axis_0_expanded",
"test_softmax_axis_1_expanded",
"test_softmax_axis_2_expanded",
"test_softmax_default_axis_expanded",
"test_softmax_example_expanded",
"test_softmax_large_number_expanded",
"test_softmax_negative_axis_expanded",
"test_softplus_example",
"test_softplus",
"test_softsign_example",
Expand Down
15 changes: 1 addition & 14 deletions iree_tests/configs/config_gpu_vulkan.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
// Timeouts?
"test_dequantizelinear",
"test_slice_default_axes",
"test_sum_example",
],
"skip_run_tests": [],
"expected_compile_failures": [
Expand Down Expand Up @@ -134,7 +133,6 @@
"test_castlike_FLOAT8E5M2FNUZ_to_FLOAT",
"test_castlike_STRING_to_FLOAT_expanded",
"test_castlike_STRING_to_FLOAT",
"test_celu_expanded",
"test_celu",
"test_center_crop_pad_crop_and_pad_expanded",
"test_center_crop_pad_crop_and_pad",
Expand All @@ -148,9 +146,7 @@
"test_center_crop_pad_crop",
"test_center_crop_pad_pad_expanded",
"test_center_crop_pad_pad",
"test_clip_default_inbounds_expanded",
"test_clip_default_inbounds",
"test_clip_default_int8_inbounds_expanded",
"test_clip_default_int8_inbounds",
"test_clip_default_int8_max",
"test_clip_default_max",
Expand Down Expand Up @@ -231,8 +227,6 @@
"test_gemm_default_no_bias",
"test_globalmaxpool_precomputed",
"test_globalmaxpool",
"test_greater_bcast",
"test_greater",
"test_gridsample_aligncorners_true",
"test_gridsample_bicubic_align_corners_0_additional_1",
"test_gridsample_bicubic_align_corners_1_additional_1",
Expand Down Expand Up @@ -371,7 +365,6 @@
"test_mod_uint8",
"test_momentum_multiple",
"test_momentum",
"test_mvn_expanded",
"test_mvn",
"test_nesterov_momentum",
"test_nllloss_NC",
Expand Down Expand Up @@ -711,13 +704,6 @@
"test_slice_negative_axes",
"test_slice_start_out_of_bounds",
"test_slice",
"test_softmax_axis_0_expanded",
"test_softmax_axis_1_expanded",
"test_softmax_axis_2_expanded",
"test_softmax_default_axis_expanded",
"test_softmax_example_expanded",
"test_softmax_large_number_expanded",
"test_softmax_negative_axis_expanded",
"test_softplus_example",
"test_softplus",
"test_softsign_example",
Expand Down Expand Up @@ -941,6 +927,7 @@
"test_castlike_FLOAT_to_FLOAT16",
"test_castlike_FLOAT16_to_FLOAT_expanded",
"test_castlike_FLOAT16_to_FLOAT",
"test_clip_default_int8_inbounds_expanded",
"test_isinf_float16",
"test_isnan_float16",
"test_max_float16",
Expand Down
83 changes: 57 additions & 26 deletions iree_tests/onnx/import_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

import argparse
import onnx
from multiprocessing import Pool
from pathlib import Path
from onnx import numpy_helper
from onnx import numpy_helper, version_converter
import shutil
import subprocess
import numpy as np
Expand All @@ -20,6 +22,9 @@
ONNX_REPO_GENERATED_TESTS_ROOT = ONNX_REPO_ROOT / "onnx/backend/test/data"
NODE_TESTS_ROOT = ONNX_REPO_GENERATED_TESTS_ROOT / "node"

# Convert test cases to at least this version using The ONNX Version Converter.
ONNX_CONVERTER_OUTPUT_MIN_VERSION = 17

# Write imported files to our own 'generated' folder.
GENERATED_FILES_OUTPUT_ROOT = REPO_ROOT / "iree_tests/onnx/node/generated"

Expand Down Expand Up @@ -48,6 +53,16 @@ def convert_io_proto(proto_filename, type_proto):
return None


def import_onnx_files_with_cleanup(test_dir_path):
test_name = test_dir_path.name
imported_dir_path = Path(GENERATED_FILES_OUTPUT_ROOT) / test_name
result = import_onnx_files(test_dir_path, imported_dir_path)
if not result:
# Note: could comment this out to keep partially imported directories.
shutil.rmtree(imported_dir_path)
return (test_name, result)


def import_onnx_files(test_dir_path, imported_dir_path):
# This imports one 'test_[name]' subfolder from this:
#
Expand All @@ -71,15 +86,32 @@ def import_onnx_files(test_dir_path, imported_dir_path):
test_data_flagfile_path = imported_dir_path / "test_data_flags.txt"
test_data_flagfile_lines = []

# Import model.onnx to model.mlir.
# TODO(scotttodd): copy the .onnx file into the generated folder? Useful for reproducing
# could also add a symlink or other files with info
# e.g. importer tool / version / flags used, reproducer command
onnx_model_path = test_dir_path / "model.onnx"
# Convert model.onnx up to ONNX_CONVERTER_OUTPUT_MIN_VERSION if needed.
# TODO(scotttodd): stamp some info e.g. importer tool / version / flags used
original_model_path = test_dir_path / "model.onnx"
converted_model_path = imported_dir_path / "model.onnx"

original_model = onnx.load_model(original_model_path)
original_version = original_model.opset_import[0].version
if original_version < ONNX_CONVERTER_OUTPUT_MIN_VERSION:
try:
converted_model = version_converter.convert_version(
original_model, ONNX_CONVERTER_OUTPUT_MIN_VERSION
)
onnx.save(converted_model, converted_model_path)
except:
# Conversion failed. Do our best with the original file.
# print(f"WARNING: ONNX conversion failed for {test_dir_path.name}")
shutil.copy(original_model_path, converted_model_path)
else:
# No conversion needed.
shutil.copy(original_model_path, converted_model_path)

# Import converted model.onnx to model.mlir.
imported_model_path = imported_dir_path / "model.mlir"
exec_args = [
"iree-import-onnx",
str(onnx_model_path),
str(converted_model_path),
"-o",
str(imported_model_path),
]
Expand All @@ -101,7 +133,7 @@ def import_onnx_files(test_dir_path, imported_dir_path):
test_data_dir = test_data_dirs[0]
test_inputs = list(test_data_dir.glob("input_*.pb"))
test_outputs = list(test_data_dir.glob("output_*.pb"))
model = onnx.load(onnx_model_path)
model = onnx.load(converted_model_path)
for i in range(len(test_inputs)):
test_input = test_inputs[i]
t = convert_io_proto(test_input, model.graph.input[i].type)
Expand All @@ -126,6 +158,16 @@ def import_onnx_files(test_dir_path, imported_dir_path):


if __name__ == "__main__":
parser = argparse.ArgumentParser(description="ONNX test case importer.")
parser.add_argument(
"-j",
"--jobs",
type=int,
default=8,
help="Number of parallel processes to use when importing test cases",
)
args = parser.parse_args()

test_dir_paths = find_onnx_tests(NODE_TESTS_ROOT)

# TODO(scotttodd): add flag to not clear output dir?
Expand All @@ -134,27 +176,16 @@ def import_onnx_files(test_dir_path, imported_dir_path):
GENERATED_FILES_OUTPUT_ROOT.mkdir(parents=True)

print(f"Importing tests in '{NODE_TESTS_ROOT}'")

print("******************************************************************")
passed_imports = []
failed_imports = []
# TODO(scotttodd): parallelize this (or move into a test runner like pytest)
for i in range(len(test_dir_paths)):
test_dir_path = test_dir_paths[i]
test_name = test_dir_path.name

current_number = str(i).rjust(4, "0")
progress_str = f"[{current_number}/{len(test_dir_paths)}]"
print(f"{progress_str}: Importing {test_name}")

imported_dir_path = Path(GENERATED_FILES_OUTPUT_ROOT) / test_name
result = import_onnx_files(test_dir_path, imported_dir_path)
if result:
passed_imports.append(test_name)
else:
failed_imports.append(test_name)
# Note: could comment this out to keep partially imported directories.
shutil.rmtree(imported_dir_path)
with Pool(args.jobs) as pool:
results = pool.imap_unordered(import_onnx_files_with_cleanup, test_dir_paths)
for result in results:
if result[1]:
passed_imports.append(result[0])
else:
failed_imports.append(result[0])
print("******************************************************************")

passed_imports.sort()
Expand Down
2 changes: 1 addition & 1 deletion iree_tests/onnx/node/generated/test_abs/model.mlir
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module {
func.func @test_abs(%arg0: !torch.vtensor<[3,4,5],f32>) -> !torch.vtensor<[3,4,5],f32> attributes {torch.onnx_meta.ir_version = 7 : si64, torch.onnx_meta.opset_version = 13 : si64, torch.onnx_meta.producer_name = "backend-test", torch.onnx_meta.producer_version = ""} {
func.func @test_abs(%arg0: !torch.vtensor<[3,4,5],f32>) -> !torch.vtensor<[3,4,5],f32> attributes {torch.onnx_meta.ir_version = 7 : si64, torch.onnx_meta.opset_version = 17 : si64, torch.onnx_meta.producer_name = "backend-test", torch.onnx_meta.producer_version = ""} {
%none = torch.constant.none
%0 = torch.operator "onnx.Abs"(%arg0) : (!torch.vtensor<[3,4,5],f32>) -> !torch.vtensor<[3,4,5],f32>
return %0 : !torch.vtensor<[3,4,5],f32>
Expand Down
2 changes: 1 addition & 1 deletion iree_tests/onnx/node/generated/test_acos/model.mlir
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module {
func.func @test_acos(%arg0: !torch.vtensor<[3,4,5],f32>) -> !torch.vtensor<[3,4,5],f32> attributes {torch.onnx_meta.ir_version = 3 : si64, torch.onnx_meta.opset_version = 7 : si64, torch.onnx_meta.producer_name = "backend-test", torch.onnx_meta.producer_version = ""} {
func.func @test_acos(%arg0: !torch.vtensor<[3,4,5],f32>) -> !torch.vtensor<[3,4,5],f32> attributes {torch.onnx_meta.ir_version = 3 : si64, torch.onnx_meta.opset_version = 17 : si64, torch.onnx_meta.producer_name = "backend-test", torch.onnx_meta.producer_version = ""} {
%none = torch.constant.none
%0 = torch.operator "onnx.Acos"(%arg0) : (!torch.vtensor<[3,4,5],f32>) -> !torch.vtensor<[3,4,5],f32>
return %0 : !torch.vtensor<[3,4,5],f32>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module {
func.func @test_acos_example(%arg0: !torch.vtensor<[3],f32>) -> !torch.vtensor<[3],f32> attributes {torch.onnx_meta.ir_version = 3 : si64, torch.onnx_meta.opset_version = 7 : si64, torch.onnx_meta.producer_name = "backend-test", torch.onnx_meta.producer_version = ""} {
func.func @test_acos_example(%arg0: !torch.vtensor<[3],f32>) -> !torch.vtensor<[3],f32> attributes {torch.onnx_meta.ir_version = 3 : si64, torch.onnx_meta.opset_version = 17 : si64, torch.onnx_meta.producer_name = "backend-test", torch.onnx_meta.producer_version = ""} {
%none = torch.constant.none
%0 = torch.operator "onnx.Acos"(%arg0) : (!torch.vtensor<[3],f32>) -> !torch.vtensor<[3],f32>
return %0 : !torch.vtensor<[3],f32>
Expand Down
2 changes: 1 addition & 1 deletion iree_tests/onnx/node/generated/test_acosh/model.mlir
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module {
func.func @test_acosh(%arg0: !torch.vtensor<[3,4,5],f32>) -> !torch.vtensor<[3,4,5],f32> attributes {torch.onnx_meta.ir_version = 4 : si64, torch.onnx_meta.opset_version = 9 : si64, torch.onnx_meta.producer_name = "backend-test", torch.onnx_meta.producer_version = ""} {
func.func @test_acosh(%arg0: !torch.vtensor<[3,4,5],f32>) -> !torch.vtensor<[3,4,5],f32> attributes {torch.onnx_meta.ir_version = 4 : si64, torch.onnx_meta.opset_version = 17 : si64, torch.onnx_meta.producer_name = "backend-test", torch.onnx_meta.producer_version = ""} {
%none = torch.constant.none
%0 = torch.operator "onnx.Acosh"(%arg0) : (!torch.vtensor<[3,4,5],f32>) -> !torch.vtensor<[3,4,5],f32>
return %0 : !torch.vtensor<[3,4,5],f32>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module {
func.func @test_acosh_example(%arg0: !torch.vtensor<[3],f32>) -> !torch.vtensor<[3],f32> attributes {torch.onnx_meta.ir_version = 4 : si64, torch.onnx_meta.opset_version = 9 : si64, torch.onnx_meta.producer_name = "backend-test", torch.onnx_meta.producer_version = ""} {
func.func @test_acosh_example(%arg0: !torch.vtensor<[3],f32>) -> !torch.vtensor<[3],f32> attributes {torch.onnx_meta.ir_version = 4 : si64, torch.onnx_meta.opset_version = 17 : si64, torch.onnx_meta.producer_name = "backend-test", torch.onnx_meta.producer_version = ""} {
%none = torch.constant.none
%0 = torch.operator "onnx.Acosh"(%arg0) : (!torch.vtensor<[3],f32>) -> !torch.vtensor<[3],f32>
return %0 : !torch.vtensor<[3],f32>
Expand Down
2 changes: 1 addition & 1 deletion iree_tests/onnx/node/generated/test_add/model.mlir
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module {
func.func @test_add(%arg0: !torch.vtensor<[3,4,5],f32>, %arg1: !torch.vtensor<[3,4,5],f32>) -> !torch.vtensor<[3,4,5],f32> attributes {torch.onnx_meta.ir_version = 7 : si64, torch.onnx_meta.opset_version = 14 : si64, torch.onnx_meta.producer_name = "backend-test", torch.onnx_meta.producer_version = ""} {
func.func @test_add(%arg0: !torch.vtensor<[3,4,5],f32>, %arg1: !torch.vtensor<[3,4,5],f32>) -> !torch.vtensor<[3,4,5],f32> attributes {torch.onnx_meta.ir_version = 7 : si64, torch.onnx_meta.opset_version = 17 : si64, torch.onnx_meta.producer_name = "backend-test", torch.onnx_meta.producer_version = ""} {
%none = torch.constant.none
%0 = torch.operator "onnx.Add"(%arg0, %arg1) : (!torch.vtensor<[3,4,5],f32>, !torch.vtensor<[3,4,5],f32>) -> !torch.vtensor<[3,4,5],f32>
return %0 : !torch.vtensor<[3,4,5],f32>
Expand Down
2 changes: 1 addition & 1 deletion iree_tests/onnx/node/generated/test_add_bcast/model.mlir
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module {
func.func @test_add_bcast(%arg0: !torch.vtensor<[3,4,5],f32>, %arg1: !torch.vtensor<[5],f32>) -> !torch.vtensor<[3,4,5],f32> attributes {torch.onnx_meta.ir_version = 7 : si64, torch.onnx_meta.opset_version = 14 : si64, torch.onnx_meta.producer_name = "backend-test", torch.onnx_meta.producer_version = ""} {
func.func @test_add_bcast(%arg0: !torch.vtensor<[3,4,5],f32>, %arg1: !torch.vtensor<[5],f32>) -> !torch.vtensor<[3,4,5],f32> attributes {torch.onnx_meta.ir_version = 7 : si64, torch.onnx_meta.opset_version = 17 : si64, torch.onnx_meta.producer_name = "backend-test", torch.onnx_meta.producer_version = ""} {
%none = torch.constant.none
%0 = torch.operator "onnx.Add"(%arg0, %arg1) : (!torch.vtensor<[3,4,5],f32>, !torch.vtensor<[5],f32>) -> !torch.vtensor<[3,4,5],f32>
return %0 : !torch.vtensor<[3,4,5],f32>
Expand Down
2 changes: 1 addition & 1 deletion iree_tests/onnx/node/generated/test_add_uint8/model.mlir
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module {
func.func @test_add_uint8(%arg0: !torch.vtensor<[3,4,5],ui8>, %arg1: !torch.vtensor<[3,4,5],ui8>) -> !torch.vtensor<[3,4,5],ui8> attributes {torch.onnx_meta.ir_version = 7 : si64, torch.onnx_meta.opset_version = 14 : si64, torch.onnx_meta.producer_name = "backend-test", torch.onnx_meta.producer_version = ""} {
func.func @test_add_uint8(%arg0: !torch.vtensor<[3,4,5],ui8>, %arg1: !torch.vtensor<[3,4,5],ui8>) -> !torch.vtensor<[3,4,5],ui8> attributes {torch.onnx_meta.ir_version = 7 : si64, torch.onnx_meta.opset_version = 17 : si64, torch.onnx_meta.producer_name = "backend-test", torch.onnx_meta.producer_version = ""} {
%none = torch.constant.none
%0 = torch.operator "onnx.Add"(%arg0, %arg1) : (!torch.vtensor<[3,4,5],ui8>, !torch.vtensor<[3,4,5],ui8>) -> !torch.vtensor<[3,4,5],ui8>
return %0 : !torch.vtensor<[3,4,5],ui8>
Expand Down
2 changes: 1 addition & 1 deletion iree_tests/onnx/node/generated/test_and2d/model.mlir
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module {
func.func @test_and2d(%arg0: !torch.vtensor<[3,4],i1>, %arg1: !torch.vtensor<[3,4],i1>) -> !torch.vtensor<[3,4],i1> attributes {torch.onnx_meta.ir_version = 3 : si64, torch.onnx_meta.opset_version = 7 : si64, torch.onnx_meta.producer_name = "backend-test", torch.onnx_meta.producer_version = ""} {
func.func @test_and2d(%arg0: !torch.vtensor<[3,4],i1>, %arg1: !torch.vtensor<[3,4],i1>) -> !torch.vtensor<[3,4],i1> attributes {torch.onnx_meta.ir_version = 3 : si64, torch.onnx_meta.opset_version = 17 : si64, torch.onnx_meta.producer_name = "backend-test", torch.onnx_meta.producer_version = ""} {
%none = torch.constant.none
%0 = torch.operator "onnx.And"(%arg0, %arg1) : (!torch.vtensor<[3,4],i1>, !torch.vtensor<[3,4],i1>) -> !torch.vtensor<[3,4],i1>
return %0 : !torch.vtensor<[3,4],i1>
Expand Down
2 changes: 1 addition & 1 deletion iree_tests/onnx/node/generated/test_and3d/model.mlir
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module {
func.func @test_and3d(%arg0: !torch.vtensor<[3,4,5],i1>, %arg1: !torch.vtensor<[3,4,5],i1>) -> !torch.vtensor<[3,4,5],i1> attributes {torch.onnx_meta.ir_version = 3 : si64, torch.onnx_meta.opset_version = 7 : si64, torch.onnx_meta.producer_name = "backend-test", torch.onnx_meta.producer_version = ""} {
func.func @test_and3d(%arg0: !torch.vtensor<[3,4,5],i1>, %arg1: !torch.vtensor<[3,4,5],i1>) -> !torch.vtensor<[3,4,5],i1> attributes {torch.onnx_meta.ir_version = 3 : si64, torch.onnx_meta.opset_version = 17 : si64, torch.onnx_meta.producer_name = "backend-test", torch.onnx_meta.producer_version = ""} {
%none = torch.constant.none
%0 = torch.operator "onnx.And"(%arg0, %arg1) : (!torch.vtensor<[3,4,5],i1>, !torch.vtensor<[3,4,5],i1>) -> !torch.vtensor<[3,4,5],i1>
return %0 : !torch.vtensor<[3,4,5],i1>
Expand Down
2 changes: 1 addition & 1 deletion iree_tests/onnx/node/generated/test_and4d/model.mlir
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module {
func.func @test_and4d(%arg0: !torch.vtensor<[3,4,5,6],i1>, %arg1: !torch.vtensor<[3,4,5,6],i1>) -> !torch.vtensor<[3,4,5,6],i1> attributes {torch.onnx_meta.ir_version = 3 : si64, torch.onnx_meta.opset_version = 7 : si64, torch.onnx_meta.producer_name = "backend-test", torch.onnx_meta.producer_version = ""} {
func.func @test_and4d(%arg0: !torch.vtensor<[3,4,5,6],i1>, %arg1: !torch.vtensor<[3,4,5,6],i1>) -> !torch.vtensor<[3,4,5,6],i1> attributes {torch.onnx_meta.ir_version = 3 : si64, torch.onnx_meta.opset_version = 17 : si64, torch.onnx_meta.producer_name = "backend-test", torch.onnx_meta.producer_version = ""} {
%none = torch.constant.none
%0 = torch.operator "onnx.And"(%arg0, %arg1) : (!torch.vtensor<[3,4,5,6],i1>, !torch.vtensor<[3,4,5,6],i1>) -> !torch.vtensor<[3,4,5,6],i1>
return %0 : !torch.vtensor<[3,4,5,6],i1>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module {
func.func @test_and_bcast3v1d(%arg0: !torch.vtensor<[3,4,5],i1>, %arg1: !torch.vtensor<[5],i1>) -> !torch.vtensor<[3,4,5],i1> attributes {torch.onnx_meta.ir_version = 3 : si64, torch.onnx_meta.opset_version = 7 : si64, torch.onnx_meta.producer_name = "backend-test", torch.onnx_meta.producer_version = ""} {
func.func @test_and_bcast3v1d(%arg0: !torch.vtensor<[3,4,5],i1>, %arg1: !torch.vtensor<[5],i1>) -> !torch.vtensor<[3,4,5],i1> attributes {torch.onnx_meta.ir_version = 3 : si64, torch.onnx_meta.opset_version = 17 : si64, torch.onnx_meta.producer_name = "backend-test", torch.onnx_meta.producer_version = ""} {
%none = torch.constant.none
%0 = torch.operator "onnx.And"(%arg0, %arg1) : (!torch.vtensor<[3,4,5],i1>, !torch.vtensor<[5],i1>) -> !torch.vtensor<[3,4,5],i1>
return %0 : !torch.vtensor<[3,4,5],i1>
Expand Down
Loading