My target is not encoded.
I am trying to classify isolated musical notes(88 exactly). Each note has input of 252 tensors, and each tensor has a variable size. That is way I can’t use the default collate_fn. You can see in getitem() function target is convert to LongTensor.
The target of each note is a tensor. If we have the note 0, tensor number 0 is filled with 1 and the rest of tensors are filled with 0.  Target for note 0:
tensor([[1., 0., 0.,  …, 0., 0., 0.],
[1., 0., 0.,  …, 0., 0., 0.],
[1., 0., 0.,  …, 0., 0., 0.],
…,
[1., 0., 0.,  …, 0., 0., 0.],
[1., 0., 0.,  …, 0., 0., 0.],
[1., 0., 0.,  …, 0., 0., 0.]])
Thanks so much!