So .item() can be used only for the condition that the tensor has only 1 element right? If the tensor has multiple elements, then .item() is not applicable?
Just to be clear, for the following case, which is a line copied from some outdated implementation, are we using detach() instead?
batch.trg.data[i, 0]