Spec-Zone.ru › TensorFlow C++ 2.9

tensorflow::ops::SparseSegmentSum

#include <math_ops.h>

Вычисляет сумму по разреженным сегментам тензора.

Краткое описание

Прочитайте раздел о сегментации для объяснения сегментов.

Как и SegmentSum, но segment_ids может иметь ранг меньше, чем ранг data по первому измерению, выбирая подмножество нулевого измерения, указанное indices.

Например:

c = tf.constant([[1,2,3,4], [-1,-2,-3,-4], [5,6,7,8]])
# Select two rows, one segment.
tf.sparse_segment_sum(c, tf.constant([0, 1]), tf.constant([0, 0]))
# => [[0 0 0 0]]
# Select two rows, two segment.
tf.sparse_segment_sum(c, tf.constant([0, 1]), tf.constant([0, 1]))
# => [[ 1  2  3  4]
#     [-1 -2 -3 -4]]
# Select all rows, two segments.
tf.sparse_segment_sum(c, tf.constant([0, 1, 2]), tf.constant([0, 0, 1]))
# => [[0 0 0 0]
#     [5 6 7 8]]
# Which is equivalent to:
tf.segment_sum(c, tf.constant([0, 0, 1]))

Аргументы:

  • scope: Объект Scope
  • indices: 1-мерный тензор. Имеет тот же ранг, что и segment_ids.
  • segment_ids: 1-мерный тензор. Значения должны быть отсортированы и могут повторяться.

Возвращает:

  • Output: Имеет ту же форму, что и данные, за исключением нулевого измерения, размер которого равен k, числу сегментов.
Конструкторы и деструкторы
SparseSegmentSum(const ::tensorflow::Scope & scope, ::tensorflow::Input data, ::tensorflow::Input indices, ::tensorflow::Input segment_ids)
Общедоступные атрибуты
operation
Operation
output
::tensorflow::Output
Общедоступные функции
node() const
::tensorflow::Node *
operator::tensorflow::Input() const
operator::tensorflow::Output() const

Общедоступные атрибуты

операция

Operation operation

вывод

::tensorflow::Output output

Общедоступные функции

SparseSegmentSum

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

узел

::tensorflow::Node * node() const 

оператор::tensorflow::Вход

operator::tensorflow::Input() const 

оператор::tensorflow::Вывод

operator::tensorflow::Output() const 

© 2022 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 4.0.
Code samples licensed under the Apache 2.0 License.
https://www.tensorflow.org/versions/r2.9/api_docs/cc/class/tensorflow/ops/sparse-segment-sum

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API