Spec-Zone.ru › TensorFlow 2.9

tf.raw_ops.Tile

Создаёт тензор путём копирования заданного тензора.

Просмотр псевдонимов

Псевдонимы для миграции

Для получения дополнительной информации см. Руководство по миграции.

tf.compat.v1.raw_ops.Tile

tf.raw_ops.Tile(
    input, multiples, name=None
)

Эта операция создаёт новый тензор, копируя input multiples раз. Размерность i-го измерения выходного тензора равна input.dims(i) * multiples[i], а значения input копируются multiples[i] раз по i-му измерению. Например, копирование [a b c d] на [2] даёт [a b c d a b c d].

a = tf.constant([[1,2,3],[4,5,6]], tf.int32)
b = tf.constant([1,2], tf.int32)
tf.tile(a, b)
<tf.Tensor: shape=(2, 6), dtype=int32, numpy=
array([[1, 2, 3, 1, 2, 3],
       [4, 5, 6, 4, 5, 6]], dtype=int32)>
c = tf.constant([2,1], tf.int32)
tf.tile(a, c)
<tf.Tensor: shape=(4, 3), dtype=int32, numpy=
array([[1, 2, 3],
       [4, 5, 6],
       [1, 2, 3],
       [4, 5, 6]], dtype=int32)>
d = tf.constant([2,2], tf.int32)
tf.tile(a, d)
<tf.Tensor: shape=(4, 6), dtype=int32, numpy=
array([[1, 2, 3, 1, 2, 3],
       [4, 5, 6, 4, 5, 6],
       [1, 2, 3, 1, 2, 3],
       [4, 5, 6, 4, 5, 6]], dtype=int32)>
Аргументы
input Tensor. 1-мерный или многомерный.
multiples Tensor. Должен быть одного из следующих типов: int32, int64. 1-мерный. Длина должна быть равна числу измерений в input
name Имя операции (необязательно).
Возвращаемое значение
Tensor. Имеет тот же тип, что и input.

© 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/versions/r2.9/api_docs/python/tf/raw_ops/Tile

Spec-Zone.ru

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