Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
UltralyticsAssistant committed Nov 26, 2024
1 parent 9d8ab70 commit 9a6efd3
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions tests/test_onnxslim.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def __test_command_basic(self, request, in_model_path=FILENAME, out_model_name="
out_model_path = os.path.join(tempdir, out_model_name)
slim(in_model_path, out_model_path)
slim(in_model_path, out_model_path, model_check=True)
command = f"onnxslim {arg_str} \"{in_model_path}\" \"{out_model_path}\""
command = f'onnxslim {arg_str} "{in_model_path}" "{out_model_path}"'
result = subprocess.run(command, shell=True, capture_output=True, text=True)
output = result.stderr.strip()
# Assert the expected return code
Expand All @@ -39,9 +39,7 @@ def test_input_shape_modification(self, request):
def test_fp322fp16_conversion(self, request):
"""Test the conversion of an ONNX model from FP32 to FP16 precision."""
dtype_fp16_arg_str = "--dtype fp16"
_, out_model_path = self.__test_command_basic(
request, FILENAME, "resnet18_fp16.onnx", dtype_fp16_arg_str
)
_, out_model_path = self.__test_command_basic(request, FILENAME, "resnet18_fp16.onnx", dtype_fp16_arg_str)
dtype_fp32_arg_str = "--dtype fp32"
self.__test_command_basic(request, out_model_path, "resnet18_fp32.onnx", dtype_fp32_arg_str)

Expand Down

0 comments on commit 9a6efd3

Please sign in to comment.