y_pred = model(image_var)
print(type(y_pred))
print(y_pred)
loss = criterion(y_pred, label)
result：
<class ‘tuple’>
(tensor([[-0.0804,  0.5624, -0.0453,  …,  0.3110,  0.1275,  0.4255],
[-0.1372,  0.1931,  0.0448,  …, -0.0704,  0.4254,  0.5051],
[-0.4169, -0.2284,  0.0816,  …,  0.2264, -0.0320,  0.1253],
…,
[-0.0581,  0.4046,  0.1634,  …, -0.1360,  0.3605, -0.3578],
[ 0.2408,  0.5761, -0.2318,  …, -0.2415,  0.4273,  0.3533],
[-0.5235, -0.4139,  0.1069,  …, -0.4818, -0.2902, -0.0036]],
device=‘cuda:0’, grad_fn=), tensor([[-0.8809,  0.3767, -3.1792,  …,  0.7448, -0.0900,  0.0051],
[-0.4402,  0.5015, -2.4917,  …,  0.9189,  1.2812, -0.9067],
[ 2.6763, -0.0138,  0.2158,  …,  0.3181,  0.1110, -1.3704],
…,
[-0.8310, -0.7097,  0.2146,  …, -0.9113, -4.0065, -0.8130],
[ 0.3442, -0.1871, -1.6047,  …, -1.9643, -0.5006, -1.1983],
[ 4.4484,  1.5294, -0.4082,  …,  1.0616,  2.4863,  0.3728]],
device=‘cuda:0’, grad_fn=))
I was amazed when I print type(y_pred) to show tuple, when I print y_pred the specific value shows tensor