norm:

This throws an error for  embedding.weight.data:
RuntimeError: mm(): argument ‘mat2’ (position 1) must be Variable, not torch.cuda.FloatTensor
Any suggestions?


Try using embedding.weight which is a Variable instead of embedding.weight.data which is a Tensor.