experimental_experiment.xbuilder._dtype_helper¶
- experimental_experiment.xbuilder._dtype_helper.dtype_to_tensor_dtype(dt: dtype) int [source]¶
Converts a torch dtype or numpy dtype into a onnx element type.
- Parameters:
to – dtype
- Returns:
onnx type
- experimental_experiment.xbuilder._dtype_helper.onnx_dtype_to_torch_dtype(itype: int) torch.dtype [source]¶
Converts an onnx type into a torch dtype.
- Parameters:
to – onnx dtype
- Returns:
torch dtype
- experimental_experiment.xbuilder._dtype_helper.string_to_elem_type(name: str) int [source]¶
Converts a string into an element type. INT64 -> TensorProto.INT64
- experimental_experiment.xbuilder._dtype_helper.torch_dtype_to_onnx_dtype(to: torch.dtype) int [source]¶
Converts a torch dtype into a onnx element type.
- Parameters:
to – torch dtype
- Returns:
onnx type