aliran tensor:: operasi:: Dimana3

#include <math_ops.h>

Memilih elemen dari x atau y , bergantung pada condition .

Ringkasan

Tensor x , dan y semuanya harus memiliki bentuk yang sama, dan keluarannya juga akan memiliki bentuk tersebut.

Tensor condition harus berupa skalar jika x dan y adalah skalar. Jika x dan y adalah vektor atau pangkat lebih tinggi, maka condition harus berupa skalar, vektor dengan ukuran yang sesuai dengan dimensi pertama x , atau harus mempunyai bentuk yang sama dengan x .

Tensor condition bertindak sebagai masker yang memilih, berdasarkan nilai pada setiap elemen, apakah elemen/baris terkait dalam keluaran harus diambil dari x (jika benar) atau y (jika salah).

Jika condition adalah vektor dan x dan y adalah matriks dengan peringkat lebih tinggi, maka ia memilih baris mana (dimensi luar) yang akan disalin dari x dan y . Jika condition mempunyai bentuk yang sama dengan x dan y , maka ia memilih elemen mana yang akan disalin dari x dan y .

Misalnya:

# '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

keluaran

::tensorflow::Output output

Fungsi publik

Dimana3

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

simpul

::tensorflow::Node * node() const 

operator::tensorflow::Masukan

 operator::tensorflow::Input() const 

operator::tensorflow::Keluaran

 operator::tensorflow::Output() const