The error is raised in nn.SmoothL1Loss, but unfortunately in the backward pass, and I’m unsure if accepting LongTensors in the forward is a bug or a feature, so feel free to create an issue on GitHub, so that it can be tracked and fixed, if needed.