@Operator(group="strings") public final class ReduceJoin extends PrimitiveOp implements Operand<String>
Computes the string join across dimensions in the given string Tensor of shape `[\\(d_0, d_1, ..., d_{n-1}\\)]`. Returns a new Tensor created by joining the input strings with the given separator (default: empty string). Negative indices are counted backwards from the end, with `-1` being equivalent to `n - 1`. If indices are not specified, joins across all dimensions beginning from `n - 1` through `0`.
For example:
# 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"
Modifier and Type | Class and Description |
---|---|
static class |
ReduceJoin.Options
Optional attributes for
ReduceJoin |
operation
Modifier and Type | Method and Description |
---|---|
Output<String> |
asOutput()
Returns the symbolic handle of a tensor.
|
static ReduceJoin |
create(Scope scope,
Operand<String> inputs,
Operand<Integer> reductionIndices,
ReduceJoin.Options... options)
Factory method to create a class wrapping a new ReduceJoin operation.
|
static ReduceJoin.Options |
keepDims(Boolean keepDims) |
Output<String> |
output()
Has shape equal to that of the input with reduced dimensions removed or
set to `1` depending on `keep_dims`.
|
static ReduceJoin.Options |
separator(String separator) |
equals, hashCode, op, toString
public static ReduceJoin create(Scope scope, Operand<String> inputs, Operand<Integer> reductionIndices, ReduceJoin.Options... options)
scope
- current scopeinputs
- The input to be joined. All reduced indices must have non-zero size.reductionIndices
- The dimensions to reduce over. Dimensions are reduced in the
order specified. Omitting `reduction_indices` is equivalent to passing
`[n-1, n-2, ..., 0]`. Negative indices from `-n` to `-1` are supported.options
- carries optional attributes valuespublic static ReduceJoin.Options keepDims(Boolean keepDims)
keepDims
- If `True`, retain reduced dimensions with length `1`.public static ReduceJoin.Options separator(String separator)
separator
- The separator to use when joining.public Output<String> output()
public Output<String> asOutput()
Operand
Inputs to TensorFlow operations are outputs of another TensorFlow operation. This method is used to obtain a symbolic handle that represents the computation of the input.
asOutput
in interface Operand<String>
OperationBuilder.addInput(Output)
Copyright © 2022. All rights reserved.