Adding more info to @larcane 's explanation,


true_value should be a LongTensor which means the type of elements inside the tensor is long.
Your true_value should have only one value. In this case, [0] or [1].
Please make it clear whether your output should be updated into [0, 1] or [1, 0]