Error using CrossEntropyLoss()

Hi Everyone. I am new to pytorch or torch. I am using CrossEntropyLoss() but its giving error as “RuntimeError: multi-target not supported at…”. I have used .mat file to load the data. What could be the reason for this error? Thanks!!

Can you show a part of the code (how do you build the targets and how do you use the loss)?

Thanks Alexis for replying. I got it. I was using a vector to denote the class i.e. [0 1 0 0] for representing class ‘1’. I found out that it has to be scalar.