텐서플로우:: 작전:: 어디에3

#include <math_ops.h>

condition 에 따라 x 또는 y 에서 요소를 선택합니다.

요약

xy 텐서는 모두 동일한 모양을 가져야 하며 출력도 해당 모양을 갖습니다.

xy 가 스칼라인 경우 condition 텐서는 스칼라여야 합니다. xy 가 벡터 이상의 순위인 경우 condition 스칼라( x 의 첫 번째 차원과 크기가 일치하는 벡터)이거나 x 와 모양이 동일해야 합니다.

condition 텐서는 각 요소의 값을 기반으로 출력의 해당 요소/행을 x (true인 경우) 또는 y (false인 경우)에서 가져와야 하는지 여부를 선택하는 마스크 역할을 합니다.

condition 이 벡터이고 xy 더 높은 순위 행렬인 경우 xy 에서 복사할 행(외부 차원)을 선택합니다. condition xy 모양이 동일한 경우 xy 에서 복사할 요소를 선택합니다.

예를 들어:

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

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

 operator::tensorflow::Input() const 

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

 operator::tensorflow::Output() const