tf.rank()
import tensorflow as tf
# shape of tensor 't' is [2, 2, 3]
t = tf.constant([[[1, 1, 1], [2, 2, 2]], [[3, 3, 3], [4, 4, 4]]])
tf.rank(t) # 3
-
張量的秩與矩陣的秩不一樣.張量的秩是唯一選擇張量的每個元素所需的索引的數量.可以理解為維度秩也被稱為 “order”,“degree” 或 “ndims”.
總結
- 上一篇: tf.Module
- 下一篇: tf.reverse