I’m a bit confused about the types that different layers are expecting.
I discovered that a nn.Embedding layer expects its input to be of type LongTensor aka torch.int64. Then it outputs a tensor of type torch.float64.
But then if I want to use a nn.LSTM layer next, I need to change the type since nn.LSTM wants torch.float32 as input, and I use for this
emb_vect = torch.tensor(emb_vect dtype=torch.float32)

and it works fine then. But I have two questions:

Why have the constraints on type?
Does changing the type of a variable in a forward function have an effect on the backpropagation?

Thanks a lot