In that case the target should contain two active classes (e.g. assuming cat and dog are class0 and class4, respectively):
tensor([[1., 0., 0., 0., 1., 0., 0., 0., 0., 0.]])

If that’s the case, just ignore my last post and refer to the one before it.