از اینکه با Google I/O تنظیم کردید متشکریم. مشاهده همه جلسات در صورت تقاضا تماشا کنید

tensorflow :: ops :: کجا 3

#include <math_ops.h>

بسته به condition عناصر را از x یا y انتخاب می کند.

خلاصه

سنسورهای x و y باید همه یک شکل داشته باشند و خروجی نیز به همان شکل خواهد بود.

اگر x و y مقیاس پذیر باشند ، سنسور condition باید مقیاس دار باشد. اگر x و y بردار یا مرتبه بالاتر هستند ، condition باید یا مقیاس باشد ، بردار با اندازه مطابق با بعد اول x ، یا باید همان شکل x باشد.

تنسور condition مانند نقابی عمل می کند که بر اساس مقدار هر عنصر ، انتخاب می کند که آیا عنصر / ردیف مربوطه در خروجی باید از x (در صورت درست) یا y (در صورت نادرست) گرفته شود.

اگر condition بردار باشد و x و y ماتریس های درجه بالاتری باشند ، پس انتخاب می کند کدام سطر (بعد بیرونی) از x و y کپی شود. اگر condition همان شکل x و y ، آنگاه انتخاب می کند کدام عنصر را از x و y کپی کند.

مثلا:

# 'condition' tensor is [[True,  False]
#                        [False, True]]
# 't' is [[1, 2],
#         [3, 4]]
# 'e' is [[5, 6],
#         [7, 8]]
select(condition, t, e)  # => [[1, 6], [7, 4]]

# 'condition' tensor is [True, False]
# 't' is [[1, 2],
#         [3, 4]]
# 'e' is [[5, 6],
#         [7, 8]]
select(condition, t, e) ==> [[1, 2],
                             [7, 8]]

  

Arguments:

  • scope: A Scope object
  • x: = A Tensor which may have the same shape as condition. If condition is rank 1, x may have higher rank, but its first dimension must match the size of condition.
  • y: = A Tensor with the same type and shape as x.

Returns:

  • Output: = A Tensor with the same type and shape as x and y.

Constructors and Destructors

Where3(const ::tensorflow::Scope & scope, ::tensorflow::Input condition, ::tensorflow::Input x, ::tensorflow::Input y)

Public attributes

operation
output

Public functions

node() const
::tensorflow::Node *
operator::tensorflow::Input() const
operator::tensorflow::Output() const

Public attributes

operation

Operation operation

خروجی

::tensorflow::Output output

کارکردهای عمومی

کجا 3

 Where3(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input condition,
  ::tensorflow::Input x,
  ::tensorflow::Input y
)

گره

::tensorflow::Node * node() const 

عملگر :: tensorflow :: ورودی

 operator::tensorflow::Input() const 

عملگر :: tensorflow :: خروجی

 operator::tensorflow::Output() const