-
Notifications
You must be signed in to change notification settings - Fork 94
Closed
Labels
bugSomething isn't workingSomething isn't workingmodule: torchlibRelated to the torch/aten function lib in developmentRelated to the torch/aten function lib in development
Description
Repro:
import torch
def func(x, y):
x[..., 0] = y
return x
x = torch.randn(2, 3, 4, dtype=torch.float32)
y = torch.randn(2, 3, dtype=torch.float64)
torch.onnx.dynamo_export(func, x, y).save("repro_copy_diff_dtype.onnx")
import onnxruntime
onnxruntime.InferenceSession("repro_copy_diff_dtype.onnx", providers=["CPUExecutionProvider"])onnxruntime.capi.onnxruntime_pybind11_state.Fail: [ONNXRuntimeError] : 1 : FAIL : Load model from repro_copy_diff_dtype.onnx failed:Type Error: Type (tensor(float)) of output arg (copy) of node (aten_copy_1) does not match expected type (tensor(double)).
- func: copy(Tensor self, Tensor src, bool non_blocking=False) -> Tensor
I'm leaning more towards handling it inside aten::copy than in type promotion, since this isn't really type promotion.
From pyhpc_turbulent_kinetic_energy cuda amp https://github.com/microsoft/onnx-converters-private/issues/196
justinchuby
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingmodule: torchlibRelated to the torch/aten function lib in developmentRelated to the torch/aten function lib in development