Pytorch Tensor from Bytes

Hello,

I’m wondering what the fast way to convert from bytes to a pytorch tensor is.

I’ve found the reverse here:
https://pytorch.org/docs/stable/generated/torch.Tensor.byte.html

Thanks

You can use .to(torch.float) or .to(torch.uint8) to go in either direction.