yobx.helpers.torch_helper

yobx.helpers.torch_helper.onnx_dtype_to_torch_dtype(itype: int) dtype[source][source]

Converts an onnx type into a torch dtype.

Parameters:

to – onnx dtype

Returns:

torch dtype

yobx.helpers.torch_helper.to_numpy(tensor: Tensor) ndarray[source][source]

Converts a torch.Tensor to numpy.ndarray.

yobx.helpers.torch_helper.torch_dtype_to_onnx_dtype(to: dtype) int[source][source]

Converts a torch dtype into a onnx element type.

Parameters:

to – torch dtype

Returns:

onnx type