텐서플로우:: 작전:: MatrixBandPart

#include <array_ops.h>

각 가장 안쪽 행렬의 중앙 밴드 외부에 있는 모든 항목을 설정하는 텐서를 복사합니다.

요약

0으로.

band 부분은 다음과 같이 계산됩니다. input k 차원 [I, J, K, ..., M, N] 이 있다고 가정하면 출력은 동일한 모양의 텐서입니다.

band[i, j, k, ..., m, n] = in_band(m, n) * input[i, j, k, ..., m, n]

표시기 기능

in_band(m, n) = (num_lower < 0 || (mn) <= num_lower)) && (num_upper < 0 || (nm) <= num_upper)

예를 들어:

# if 'input' is [[ 0,  1,  2, 3]
                 [-1,  0,  1, 2]
                 [-2, -1,  0, 1]
                 [-3, -2, -1, 0]],

tf.matrix_band_part(input, 1, -1) ==> [[ 0,  1,  2, 3]
                                       [-1,  0,  1, 2]
                                       [ 0, -1,  0, 1]
                                       [ 0,  0, -1, 0]],

tf.matrix_band_part(input, 2, 1) ==> [[ 0,  1,  0, 0]
                                      [-1,  0,  1, 0]
                                      [-2, -1,  0, 1]
                                      [ 0, -2, -1, 0]]

유용한 특수 사례:

 tf.matrix_band_part(input, 0, -1) ==> Upper triangular part.
 tf.matrix_band_part(input, -1, 0) ==> Lower triangular part.
 tf.matrix_band_part(input, 0, 0) ==> Diagonal.

인수:

  • 범위: 범위 개체
  • 입력: 순위 k 텐서.
  • num_lower: 0차원 텐서. 유지할 하부대각선의 수입니다. 음수인 경우 아래쪽 삼각형 전체를 유지합니다.
  • num_upper: 0차원 텐서. 유지할 상부대각선의 수입니다. 음수인 경우 전체 위쪽 삼각형을 유지합니다.

보고:

  • Output : 입력과 동일한 모양의 순위 k 텐서. 추출된 줄무늬 텐서.

생성자와 소멸자

MatrixBandPart (const :: tensorflow::Scope & scope, :: tensorflow::Input input, :: tensorflow::Input num_lower, :: tensorflow::Input num_upper)

공개 속성

band
operation

공공 기능

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

공개 속성

밴드

::tensorflow::Output band

작업

Operation operation

공공 기능

MatrixBandPart

 MatrixBandPart(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input input,
  ::tensorflow::Input num_lower,
  ::tensorflow::Input num_upper
)

마디

::tensorflow::Node * node() const 

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

 operator::tensorflow::Input() const 

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

 operator::tensorflow::Output() const