Skip to content

input in Long type #77

@sungjchi

Description

@sungjchi

My model has an input in Long dtype which is passed to an torch.nn.Embedding layer. Since all the input data are created in torch.FloatTensor type, it creates runtime error when these inputs are passed to an embedding layer. Should there be an argument to choose which data type to pass to inputs?

In the code below, the third input is passed through an embedding layer and thus cause a runtime error.

(Pdb) summary(m,[(170,),(800,80),(170,),(800,)])
*** RuntimeError: Expected tensor for argument #1 'indices' to have scalar type Long; but got CUDAType instead (while checking arguments for embedding)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions