Closed
Description
Hi, when initializing a Tensor using a numpy compatible scalar with an explicit dtype, the resulting numpy() call returns the wrong data type:
import numpy as np
from onnx_ir import DataType, Tensor
tensor = Tensor(value=np.float32(0.5), dtype=DataType.FLOAT)
print(tensor.numpy().dtype) # outputs float64 instead of float32
Potential fix
Maybe pass the dtype of _raw
here
Line 491 in e211825
return self.__array__(self._raw.dtype)