Skip to content

ToTensor Device #2925

@bhashemian

Description

@bhashemian

Is your feature request related to a problem? Please describe.
Currently when converting from other formats that can reside on gpu like cupy to torch tensor, using ToTensor, it will create the tensor on the cpu, and then it should be sent to gpu using ToDevice. This will create unnecessary between cpu and gpu and reduce the performance. A solution to that is to have ToTensor accept device parameter and directly create the tensor on that machine, and in this case on gpu.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions