tensorflow :: ops :: ExpandDims

#include <array_ops.h>

텐서의 모양에 차원 1을 삽입합니다.

요약

텐서 input 이 주어지면이 연산은 input 형태의 차원 인덱스 axis 에 차원 1을 삽입합니다. 차원 인덱스 axis 0에서 시작합니다. axis 음수를 지정하면 끝에서부터 역으로 계산됩니다.

이 작업은 단일 요소에 배치 차원을 추가하려는 경우에 유용합니다. 예를 들어 [height, width, channels] 모양의 단일 이미지가있는 경우 expand_dims(image, 0) 하여 1 개의 이미지를 배치하여 [1, height, width, channels] 모양을 만들 수 있습니다 [1, height, width, channels] .

다른 예 :

# 't' is a tensor of shape [2]
shape(expand_dims(t, 0)) ==> [1, 2]
shape(expand_dims(t, 1)) ==> [2, 1]
shape(expand_dims(t, -1)) ==> [2, 1]

# 't2' is a tensor of shape [2, 3, 5]
shape(expand_dims(t2, 0)) ==> [1, 2, 3, 5]
shape(expand_dims(t2, 2)) ==> [2, 3, 1, 5]
shape(expand_dims(t2, 3)) ==> [2, 3, 5, 1]

이 작업에는 다음이 필요합니다.

-1-input.dims() <= dim <= input.dims()

이 작업은 크기 1의 차원을 제거하는 squeeze() 와 관련이 있습니다.

인수 :

  • 범위 : 범위 개체
  • 축 : 0-D (스칼라). input 의 모양을 확장 할 차원 인덱스를 지정합니다. [-rank(input) - 1, rank(input)] 범위에 있어야합니다.

보고:

  • Output : input 과 동일한 데이터를 포함하지만 그 모양에 크기 1의 추가 차원이 추가되었습니다.

생성자와 소멸자

ExpandDims (const :: tensorflow::Scope & scope, :: tensorflow::Input input, :: tensorflow::Input axis)

공용 속성

operation
output

공공 기능

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

공용 속성

조작

Operation operation

산출

::tensorflow::Output output

공공 기능

ExpandDims

 ExpandDims(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input input,
  ::tensorflow::Input axis
)

마디

::tensorflow::Node * node() const 

연산자 :: tensorflow :: 입력

 operator::tensorflow::Input() const 

연산자 :: tensorflow :: 출력

 operator::tensorflow::Output() const