TensorFlow2.0(1):基本数据结构——张量
1 排序
1.1 sort:返回逆序排序后的Tensor
import tensorflow as tf
a = tf.random.shuffle...=149, shape=(3, 3), dtype=int32, numpy=
array([[0, 0, 0],
[2, 2, 2],
[1, 1, 1]])>
返回的张量中...,每一个元素表示b中原来元素在该行中的索引。...,默认比较的是第0维度的元素,也就是每一列数据;对于shape为(3,3,3)的Tensor,argmin(a)返回的是shape为(3,3)的Tensor,默认比较的是第0维度的元素,也就是每一块对应位置的元素...,例如第一块的5、第二块的9、第三块的9比较,第一块的5最小,索引为0,所以返回的Tensor中第一个元素是0。