tensorflow::ops::ReduceJoin
#include <string_ops.h>
Объединяет строковый тензор Tensor по заданным измерениям.
Краткое описание
Вычисляет объединение строк по измерениям в заданном строковом тензоре Tensor формы [\\(d_0, d_1, ..., d_{n-1}\\)]. Возвращает новый Tensor, созданный путем объединения входных строк с заданным разделителем (по умолчанию: пустая строка). Отрицательные индексы считаются от конца, где -1 эквивалентно n - 1. Если индексы не указаны, объединение происходит по всем измерениям, начиная с n - 1 до 0.
Например:
# tensor `a` is [["a", "b"], ["c", "d"]] tf.reduce_join(a, 0) ==> ["ac", "bd"] tf.reduce_join(a, 1) ==> ["ab", "cd"] tf.reduce_join(a, -2) = tf.reduce_join(a, 0) ==> ["ac", "bd"] tf.reduce_join(a, -1) = tf.reduce_join(a, 1) ==> ["ab", "cd"] tf.reduce_join(a, 0, keep_dims=True) ==> [["ac", "bd"]] tf.reduce_join(a, 1, keep_dims=True) ==> [["ab"], ["cd"]] tf.reduce_join(a, 0, separator=".") ==> ["a.c", "b.d"] tf.reduce_join(a, [0, 1]) ==> "acbd" tf.reduce_join(a, [1, 0]) ==> "abcd" tf.reduce_join(a, []) ==> [["a", "b"], ["c", "d"]] tf.reduce_join(a) = tf.reduce_join(a, [1, 0]) ==> "abcd"
Аргументы:
- scope: Объект Scope
- inputs: Входной тензор для объединения. Все индексы, по которым выполняется сокращение, должны иметь ненулевой размер.
- reduction_indices: Измерения, по которым выполняется объединение. Измерения объединяются в указанном порядке. Пропуск
reduction_indicesэквивалентно передаче[n-1, n-2, ..., 0]. Поддерживаются отрицательные индексы от-nдо-1.
Дополнительные атрибуты (см. Attrs):
- keep_dims: Если
True, сохраняются уменьшенные измерения длиной1. - separator: Разделитель, используемый при объединении.
Возвращает:
-
Output: Имеет форму, равную форме входа с удаленными уменьшенными измерениями или установленной в1в зависимости отkeep_dims.
| Конструкторы и деструкторы | |
|---|---|
ReduceJoin(const ::tensorflow::Scope & scope, ::tensorflow::Input inputs, ::tensorflow::Input reduction_indices) | |
ReduceJoin(const ::tensorflow::Scope & scope, ::tensorflow::Input inputs, ::tensorflow::Input reduction_indices, const ReduceJoin::Attrs & attrs) |
| Публичные атрибуты | |
|---|---|
operation | |
output | |
| Публичные функции | |
|---|---|
node() const | ::tensorflow::Node * |
operator::tensorflow::Input() const | |
operator::tensorflow::Output() const | |
| Публичные статические функции | |
|---|---|
KeepDims(bool x) | |
Separator(StringPiece x) | |
| Структуры | |
|---|---|
| tensorflow::ops::ReduceJoin::Attrs | Дополнительные параметры установки атрибутов для ReduceJoin. |
Публичные атрибуты
operation
Operation operation
output
::tensorflow::Output output
Публичные функции
ReduceJoin
ReduceJoin( const ::tensorflow::Scope & scope, ::tensorflow::Input inputs, ::tensorflow::Input reduction_indices )
ReduceJoin
ReduceJoin( const ::tensorflow::Scope & scope, ::tensorflow::Input inputs, ::tensorflow::Input reduction_indices, const ReduceJoin::Attrs & attrs )
node
::tensorflow::Node * node() const
operator::tensorflow::Input
operator::tensorflow::Input() const
operator::tensorflow::Output
operator::tensorflow::Output() const
Публичные статические функции
KeepDims
Attrs KeepDims( bool x )
Separator
Attrs Separator( StringPiece 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/reduce-join