تدفق التوتر:: العمليات:: أين3

#include <math_ops.h>

تحديد العناصر من x أو y ، حسب condition .

ملخص

يجب أن يكون للموترين x و y نفس الشكل، وسيكون للمخرجات هذا الشكل أيضًا.

يجب أن يكون موتر condition عدديًا إذا كانت x و y عدديًا. إذا كان 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