tf.keras.backend.stack
| Просмотреть исходный код на GitHub |
Складывает список тензоров ранга R в тензор ранга R+1.
tf.keras.backend.stack(
x, axis=0
)
| Аргументы | |
|---|---|
x | Список тензоров. |
axis | Ось, вдоль которой выполнять укладку. |
| Возвращаемое значение | |
|---|---|
| Тензор. |
Пример:
a = tf.constant([[1, 2],[3, 4]])
b = tf.constant([[10, 20],[30, 40]])
tf.keras.backend.stack((a, b))
<tf.Tensor: shape=(2, 2, 2), dtype=int32, numpy=
array([[[ 1, 2],
[ 3, 4]],
[[10, 20],
[30, 40]]], dtype=int32)>
© 2020 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 3.0.
Code samples licensed under the Apache 2.0 License.
https://www.tensorflow.org/versions/r2.3/api_docs/python/tf/keras/backend/stack