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)
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)