tf.keras.ops.broadcast_to
Транслирует тензор к новой форме.
tf.keras.ops.broadcast_to(
x, shape
)
| Аргументы | |
|---|---|
x | Тензор для трансляции. |
shape | Форма требуемого тензора. Единственное целое число i интерпретируется как (i,). |
| Возвращаемое значение | |
|---|---|
| Тензор требуемой формы. |
Примеры:
x = keras.ops.array([1, 2, 3])
keras.ops.broadcast_to(x, (3, 3))
array([[1, 2, 3],
[1, 2, 3],
[1, 2, 3]])
© 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/broadcast_to