torch_outputs = torch_model(*example_inputs) assert len(torch_outputs) == len(onnxruntime_outputs) for torch_output, onnxruntime_output in zip(torch_outputs, onnxruntime_outputs): torch.testing.assert_close(torch_output, torch.tensor(onnxruntime_output)) print("PyTorch and ONNX Runtime output matched!") print(f"Output length: {len(onnxruntime_outputs)}") print(f"Sample output: {onnxruntime_outputs}")