Spec-Zone.ru › TensorFlow

tf.raw_ops.If

output = cond ? then_branch(input) : else_branch(input)

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

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

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

tf.compat.v1.raw_ops.If

tf.raw_ops.If(
    cond, input, Tout, then_branch, else_branch, output_shapes=[], name=None
)
Аргументы
cond A Tensor. A Tensor. Если тензор является скаляром не булевского типа, скаляр преобразуется в булевый согласно следующему правилу: если скаляр является числовым значением, отличным от нуля, это True, а ноль означает False; если скаляр является строкой, непустая строка означает True, а пустая — False. Если тензор не скаляр, пустота означает False, а непустота — True.
input A list of Tensor objects. A list of input tensors.
Tout A list of tf.DTypes. A list of output types.
then_branch A function decorated with @Defun. A function that takes 'inputs' and returns a list of tensors, whose types are the same as what else_branch returns.
else_branch A function decorated with @Defun. A function that takes 'inputs' and returns a list of tensors, whose types are the same as what then_branch returns.
output_shapes An optional list of shapes (each a tf.TensorShape or list of ints). Defaults to [].
name A name for the operation (optional).
Возвращаемые значения
A list of Tensor objects of type Tout.

© 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/raw_ops/If

Spec-Zone.ru

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