What type is batch.reward? If it’s a list, could you check if all tensors have the same dtype?
Based on the error message it seems that some tensors might be stored as IntTensors while others might be LongTensors.
If that’s the case, convert them to the same type via tensor.int() or tensor.long().