spdl.io.to_torch

to_torch(buffer: ArrayInterface | CUDABuffer) Tensor[source]

Convert to PyTorch Tensor.

Parameters:

buffer – Object that implements the array interface protocol

:param (has __array_interface__) or CUDABuffer object.:

Returns:

A PyTorch Tensor.

Return type:

(torch.Tensor)