# Loss funciton has a mistake?

Dear all:
when I read the code of pytorch transform_learnning tuitorials, I see the code below:

outputs = model(inputs)
_, preds = torch.max(outputs, 1)
loss = criterion(outputs, labels)

it seems that mistake in the documentation of the loss funciton.
i think that the loss should be like as:

loss = criterion(preds, labels)

Thanks .

The argument passed to criterion should be a posibility map which is the output of network and calculated by `softmax` or `sigmoid` functions.

`preds` you mentioned above is in sparse format.

Thanks, I get it. It seems that I make a mistake in parameter needed by Function “criterion”.