numpy几乎是一样的。...= tf.where(c<0)
#将张量的第[0,0]和[2,1]两个位置元素替换为0得到新的张量
d = c - tf.scatter_nd([[0,0],[2,1]],[c[0,0],c[2,1]...可以用于对张量排序
a = tf.constant([1,3,7,5,4,8])
values,indices = tf.math.top_k(a,3,sorted=True) #将a中的元素按照从大到小排序...大部分和矩阵有关的运算都在tf.linalg子包中。...矩阵转置
a = tf.constant([[1.0,2],[3,4]])
tf.transpose(a)
#结果
tf.Tensor: shape=(2, 2), dtype=float32, numpy