[Pytorch] What is tensor (2)

3.Reduction operations

1. We often use the Argmax function on the neural network output prediction tensor, which allows us to determine which class has the highest prediction value.
This is because each metric of the output tensor corresponds to a specific predicted class.
1. Looking at these operations, when we call them the mean of 3x3 tensors, the output of the reduction is a scalar tensor.
2. If we want to get the value as a number, we can use item(), which only works on scalar tensors.

4.Access operations(略)

Guess you like

Origin blog.csdn.net/weixin_66896881/article/details/128620630