Skip to content

Allow for transforms.ToTensor to return a Tensor of type torch.uint8 #1595

@r-zenine

Description

@r-zenine

Hi Everyone,

This is my first issue in the project. Please forgive me if I overstep.

I would like to have the ability when I transform PIL images using Torchvision to get back a uint8 Tensor.

I am reimplementing a flavor of DQN with experience replay where I have to store frames of an atari game in a big buffer. Storing these tensors as uint8 as opposed to floats allows me to save some memory and have bigger buffers.

I don't know if it is the feature requested is even relevant for you and whether it makes sense to update ToTensor to do it.

I would like to contribute to PyTorch more in the future because I am a big fan of this piece of technology and would be willing to do the work as my first modest contribution if you think this can be useful.

Thank you all

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions