TorchTensor¶
- class onnx_ir.tensor_adapters.TorchTensor(tensor, name=None, doc_string=None)[source]¶
- Parameters:
tensor (torch.Tensor)
name (str | None)
doc_string (str | None)
- numpy()[source]¶
Return the tensor as a numpy array.
When the data type is not supported by numpy, the dtypes from the
ml_dtypepackage are used. The values can be reinterpreted as bit representations using the.view()method.