텐서플로우:: ops:: Where3

#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

공공 기능

Where3

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

마디

::tensorflow::Node * node() const 

연산자::텐서플로우::입력

 operator::tensorflow::Input() const 

연산자::텐서플로우::출력

 operator::tensorflow::Output() const