dgs.utils.utils.torch_to_numpy

dgs.utils.utils.torch_to_numpy(tensor: torch.Tensor) ndarray[source]

Clone and convert torch tensor to numpy.

Parameters:

tensor – Torch tensor on arbitrary hardware.

Returns:

A single numpy array with the same shape and type as the original tensor.