텐서플로우:: ops:: 브로드캐스트투

#include <array_ops.h>

호환 가능한 형태의 배열을 브로드캐스트합니다.

요약

브로드캐스팅은 산술 연산에 적합한 형태로 배열을 만드는 과정입니다. 두 형태가 호환된다는 것은 각 차원 쌍에 대해 두 형태가 같거나 둘 중 하나가 1이라는 것을 의미합니다. 텐서를 특정 형태로 브로드캐스팅할 때는 후행 차원부터 시작하여 앞쪽으로 진행합니다.

예를 들어,

x = tf.constant([1, 2, 3]) y = tf.broadcast_to(x, [3, 3]) print(y) tf.Tensor( [[1 2 3] [1 2 3] [1 2 3]], shape=(3, 3), dtype=int32)

위 예시에서 [1, 3] 형태의 입력 텐서는 [3, 3] 형태의 출력 텐서 로 브로드캐스팅됩니다.

텐서와 스칼라를 곱하는 것과 같은 브로드캐스팅 연산을 수행할 때, 브로드캐스팅된 텐서는 실제로 생성되지 않으므로 (일반적으로) 시간이나 공간 측면에서 이점을 제공합니다.

하지만 broadcast_to 그러한 이점을 제공하지 않습니다. 새로 생성된 텐서는 브로드캐스트된 형태의 전체 메모리를 차지합니다. (그래프 컨텍스트에서는 broadcast_to 후속 연산에 통합된 후 최적화되어 제거될 수도 있습니다.)

논거:

보고:

생성자와 소멸자

BroadcastTo (const :: tensorflow::Scope & scope, :: tensorflow::Input input, :: tensorflow::Input shape)

공개 속성

operation
output

공공 기능

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

공개 속성

작업

Operation operation

산출

::tensorflow::Output output

공공 기능

방송 대상

 BroadcastTo(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input input,
  ::tensorflow::Input shape
)

마디

::tensorflow::Node * node() const 

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

 operator::tensorflow::Input() const 

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

 operator::tensorflow::Output() const