Spec-Zone.ru › TensorFlow

tf.keras.ops.shape

Gets the shape of the tensor input.

tf.keras.ops.shape(
    x
)
Note: On the TensorFlow backend, when x is a tf.Tensor with dynamic shape, dimensions which are dynamic in the context of a compiled function will have a tf.Tensor value instead of a static integer value.
Args
x A tensor. This function will try to access the shape attribute of the input tensor.
Returns
A tuple of integers or None values, indicating the shape of the input tensor.

Example:

x = keras.zeros((8, 12))
keras.ops.shape(x)
(8, 12)

© 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/keras/ops/shape

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API