tensorflow::ops::UnsortedSegmentJoin
#include <string_ops.h>
Объединяет элементы inputs на основе segment_ids.
Краткое описание
Вычисляет объединение строк по сегментам тензора. Дано segment_ids ранга N и data ранга N+M:
`output[i, k1...kM] = strings.join([data[j1...jN, k1...kM])`
где объединение происходит по всем [j1...jN] таким, что segment_ids[j1...jN] = i. Строки объединяются в порядке следования строк в матрице.
Например:
inputs = [['Y', 'q', 'c'], ['Y', '6', '6'], ['p', 'G', 'a']]
output_array = string_ops.unsorted_segment_join(inputs=inputs,
segment_ids=[1, 0, 1],
num_segments=2,
separator=':'))
# output_array ==> [['Y', '6', '6'], ['Y:p', 'q:G', 'c:a']]
inputs = ['this', 'is', 'a', 'test']
output_array = string_ops.unsorted_segment_join(inputs=inputs,
segment_ids=[0, 0, 0, 0],
num_segments=1,
separator=':'))
# output_array ==> ['this:is:a:test']
Аргументы:
- scope: Объект Scope
- inputs: Входные данные для объединения.
- segment_ids: Тензор, форма которого является префиксом формы data.shape. Отрицательные индексы сегментов не поддерживаются.
- num_segments: Скаляр.
Необязательные атрибуты (см. Attrs):
- separator: Разделитель, используемый при объединении.
Возвращает:
-
Output: Результирующий тензор.
| Конструкторы и деструкторы | |
|---|---|
UnsortedSegmentJoin(const ::tensorflow::Scope & scope, ::tensorflow::Input inputs, ::tensorflow::Input segment_ids, ::tensorflow::Input num_segments) | |
UnsortedSegmentJoin(const ::tensorflow::Scope & scope, ::tensorflow::Input inputs, ::tensorflow::Input segment_ids, ::tensorflow::Input num_segments, const UnsortedSegmentJoin::Attrs & attrs) |
| Публичные атрибуты | |
|---|---|
operation | |
output | |
| Публичные функции | |
|---|---|
node() const | ::tensorflow::Node * |
operator::tensorflow::Input() const | |
operator::tensorflow::Output() const | |
| Публичные статические функции | |
|---|---|
Separator(StringPiece x) | |
| Структуры | |
|---|---|
| tensorflow::ops::UnsortedSegmentJoin::Attrs | Необязательные установщики атрибутов для UnsortedSegmentJoin. |
Публичные атрибуты
операция
Operation operation
выход
::tensorflow::Output output
Публичные функции
UnsortedSegmentJoin
UnsortedSegmentJoin( const ::tensorflow::Scope & scope, ::tensorflow::Input inputs, ::tensorflow::Input segment_ids, ::tensorflow::Input num_segments )
UnsortedSegmentJoin
UnsortedSegmentJoin( const ::tensorflow::Scope & scope, ::tensorflow::Input inputs, ::tensorflow::Input segment_ids, ::tensorflow::Input num_segments, const UnsortedSegmentJoin::Attrs & attrs )
узел
::tensorflow::Node * node() const
оператор::tensorflow::Вход
operator::tensorflow::Input() const
оператор::tensorflow::Выход
operator::tensorflow::Output() const
Публичные статические функции
Разделитель
Attrs Separator( StringPiece x )
© 2020 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.4/api_docs/cc/class/tensorflow/ops/unsorted-segment-join