Spec-Zone.ru › TensorFlow 1.15

tf.eye

Просмотреть исходный код на GitHub

Создаёт единичную матрицу или набор матриц.

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

Основные псевдонимы

tf.linalg.eye

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

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

tf.compat.v1.eye, tf.compat.v1.linalg.eye, `tf.compat.v2.eye`, `tf.compat.v2.linalg.eye`

tf.eye(
    num_rows, num_columns=None, batch_shape=None, dtype=tf.dtypes.float32, name=None
)
# Construct one identity matrix.
tf.eye(2)
==> [[1., 0.],
     [0., 1.]]

# Construct a batch of 3 identity matricies, each 2 x 2.
# batch_identity[i, :, :] is a 2 x 2 identity matrix, i = 0, 1, 2.
batch_identity = tf.eye(2, batch_shape=[3])

# Construct one 2 x 3 "identity" matrix
tf.eye(2, num_columns=3)
==> [[ 1.,  0.,  0.],
     [ 0.,  1.,  0.]]
Аргументы
num_rows Неотрицательное скалярное значение int32 Tensor, задающее количество строк в каждой матрице набора.
num_columns Необязательное неотрицательное скалярное значение int32 Tensor, задающее количество столбцов в каждой матрице набора. По умолчанию num_rows.
batch_shape Список или кортеж Python-целых чисел или одномерный int32 Tensor. При указании, возвращаемая Tensor будет иметь базовые размерности партии с заданной формой.
dtype Тип элемента в результирующей Tensor
name Имя этой Op. По умолчанию "eye".
Возвращаемое значение
Tensor с формой batch_shape + [num_rows, num_columns]

© 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/r1.15/api_docs/python/tf/eye

Spec-Zone.ru

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