Tips
Last updated
Last updated
I encountered this interesting problem when I was practicing a hands-on tensorflow project.
The rank of a tensor is not the same as the rank of a matrix. The rank of a tensor is the number of indices required to uniquely select each element of the tensor. Rank is also known as "order", "degree", or "ndims."
If you type:
and we will get:
It's especially important for the API tf.argmax()
which you can refer to at . For the parameter axis
:
axis: A
Tensor
. Must be one of the following types:int32
,int64
. int32 or int64, must be in the range[-tf.rank(input), tf.rank(input))
. Describes which axis of the input Tensor to reduce across. For vectors, use axis = 0.
0 - reduce by column, 1 - reduce by row, 2 - reduce by the third dimension, et cetera.