tf.compat.v1.shape
Возвращает форму тензора.
tf.compat.v1.shape(
input, name=None, out_type=None
)
Используется в ноутбуках
| Используется в учебниках |
|---|
Эта операция возвращает 1-мерный целочисленный тензор, представляющий форму input.
Например:
t = tf.constant([[[1, 1, 1], [2, 2, 2]], [[3, 3, 3], [4, 4, 4]]]) tf.shape(t) # [2, 2, 3]
| Аргументы | |
|---|---|
input | Tensor или SparseTensor. |
name | Имя операции (необязательно). |
out_type | (Необязательно) Указанный тип результата операции (int32 или int64). По умолчанию tf.int32. |
| Возвращаемое значение | |
|---|---|
Tensor типа out_type. |
© 2022 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 4.0.
Code samples licensed under the Apache 2.0 License.
https://www.tensorflow.org/api_docs/python/tf/compat/v1/shape