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

#include <math_ops.h>

텐서의 희소 세그먼트를 따라 합계를 계산합니다.

요약

SparseSegmentSum 과 유사하지만, segment_ids 에 누락된 ID를 허용합니다. ID가 잘못된 경우 해당 위치의 output 텐서는 0이 됩니다.

세그먼트에 대한 설명은 세그먼트화 섹션을 읽어보세요.

예를 들어:

c = tf.constant([[1,2,3,4], [-1,-2,-3,-4], [5,6,7,8]])

tf.sparse_segment_sum_with_num_segments(
    c, tf.constant([0, 1]), tf.constant([0, 0]), num_segments=3)
# => [[0 0 0 0]
#     [0 0 0 0]
#     [0 0 0 0]]

tf.sparse_segment_sum_with_num_segments(c,
                                        tf.constant([0, 1]),
                                        tf.constant([0, 2],
                                        num_segments=4))
# => [[ 1  2  3  4]
#     [ 0  0  0  0]
#     [-1 -2 -3 -4]
#     [ 0  0  0  0]]

인수:

  • 범위: 범위 개체
  • 인덱스: 1차원 텐서. segment_ids 와 순위가 동일합니다.
  • 세그먼트_ID: 1차원 텐서. 값은 정렬되어야 하며 반복될 수 있습니다.
  • num_segments: 개별 세그먼트 ID의 수와 동일해야 합니다.

보고:

  • Output : 크기가 num_segments 인 차원 0을 제외하고는 데이터와 모양이 동일합니다.

생성자와 소멸자

SparseSegmentSumWithNumSegments (const :: tensorflow::Scope & scope, :: tensorflow::Input data, :: tensorflow::Input indices, :: tensorflow::Input segment_ids, :: tensorflow::Input num_segments)

공개 속성

operation
output

공공 기능

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

공개 속성

작업

Operation operation

산출

::tensorflow::Output output

공공 기능

SparseSegmentSumWithNumSegments

 SparseSegmentSumWithNumSegments(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input data,
  ::tensorflow::Input indices,
  ::tensorflow::Input segment_ids,
  ::tensorflow::Input num_segments
)

마디

::tensorflow::Node * node() const 

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

 operator::tensorflow::Input() const 

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

 operator::tensorflow::Output() const