RuntimeError: expected scalar type Long but found BFloat16

File “/opt/anaconda3/envs/my-rdkit-env/lib/python3.9/site-packages/torch/nn/modules/linear.py”, line 103, in forward
return F.linear(input, self.weight, self.bias)
RuntimeError: expected scalar type Long but found BFloat16

Without having more information than this error message, I can only recommend to check the dtypes of the input data and the model, and make sure they are matching. If you are using torch.cuda.amp.autocast, the transformations should be done internally for you.