tensorflow::ops::SparseBincount
#include <math_ops.h>
Подсчитывает количество вхождений каждого значения в целочисленном массиве.
Краткое описание
Возвращает вектор длины size и того же типа данных, что и weights. Если weights пусты, то в индексе i хранится количество раз, которое значение i учитывается в arr. Если weights не пусты, то в индексе i хранится сумма значений в weights для каждого индекса, в котором соответствующее значение в arr равно i.
Значения в arr, выходящие за пределы диапазона [0, size), игнорируются.
Аргументы:
- scope: объект Scope
- indices: 2D int64
Tensor. - values: 1D int
Tensor. - dense_shape: 1D int64
Tensor. - size: неотрицательный скаляр int
Tensor. - weights:
Tensorтипа int32, int64, float32 или float64 с той же формой, что иinput, либоTensorнулевой длины. В последнем случае все веса равны 1.
Необязательные атрибуты (см. Attrs):
- binary_output: bool; определяет, должна ли операция подсчитывать наличие значения или количество его вхождений.
Возвращает:
-
Output: 1DTensorдлиныsizeили 2DTensorс формой [batch_size,size]. Количество или сумма весов для каждого значения в диапазоне [0, size).
| Конструкторы и деструкторы | |
|---|---|
SparseBincount(const ::tensorflow::Scope & scope, ::tensorflow::Input indices, ::tensorflow::Input values, ::tensorflow::Input dense_shape, ::tensorflow::Input size, ::tensorflow::Input weights) | |
SparseBincount(const ::tensorflow::Scope & scope, ::tensorflow::Input indices, ::tensorflow::Input values, ::tensorflow::Input dense_shape, ::tensorflow::Input size, ::tensorflow::Input weights, const SparseBincount::Attrs & attrs) |
| Общедоступные атрибуты | |
|---|---|
operation | |
output | |
| Общедоступные функции | |
|---|---|
node() const | ::tensorflow::Node * |
operator::tensorflow::Input() const | |
operator::tensorflow::Output() const | |
| Общедоступные статические функции | |
|---|---|
BinaryOutput(bool x) | |
| Структуры | |
|---|---|
| tensorflow::ops::SparseBincount::Attrs | Функции установки необязательных атрибутов для SparseBincount. |
Общедоступные атрибуты
operation
Operation operation
output
::tensorflow::Output output
Общедоступные функции
SparseBincount
SparseBincount( const ::tensorflow::Scope & scope, ::tensorflow::Input indices, ::tensorflow::Input values, ::tensorflow::Input dense_shape, ::tensorflow::Input size, ::tensorflow::Input weights )
SparseBincount
SparseBincount( const ::tensorflow::Scope & scope, ::tensorflow::Input indices, ::tensorflow::Input values, ::tensorflow::Input dense_shape, ::tensorflow::Input size, ::tensorflow::Input weights, const SparseBincount::Attrs & attrs )
node
::tensorflow::Node * node() const
operator::tensorflow::Input
operator::tensorflow::Input() const
operator::tensorflow::Output
operator::tensorflow::Output() const
Общедоступные статические функции
BinaryOutput
Attrs BinaryOutput( bool x )
© 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/api_docs/cc/class/tensorflow/ops/sparse-bincount