ReduceJoin

public final class ReduceJoin

Joins a string Tensor across the given dimensions.

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"
 

Nested Classes

class ReduceJoin.Options Optional attributes for ReduceJoin  

Constants

String OP_NAME The name of this op, as known by TensorFlow core engine

Public Methods

Output<TString>
asOutput()
Returns the symbolic handle of the tensor.
static ReduceJoin
create(Scope scope, Operand<TString> inputs, Operand<TInt32> reductionIndices, Options... options)
Factory method to create a class wrapping a new ReduceJoin operation.
static ReduceJoin.Options
keepDims(Boolean keepDims)
Output<TString>
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)

Inherited Methods

Constants

public static final String OP_NAME

The name of this op, as known by TensorFlow core engine

Constant Value: "ReduceJoin"

Public Methods

public Output<TString> asOutput ()

Returns the symbolic handle of the tensor.

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.

public static ReduceJoin create (Scope scope, Operand<TString> inputs, Operand<TInt32> reductionIndices, Options... options)

Factory method to create a class wrapping a new ReduceJoin operation.

Parameters
scope current scope
inputs 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 values
Returns
  • a new instance of ReduceJoin

public static ReduceJoin.Options keepDims (Boolean keepDims)

Parameters
keepDims If `True`, retain reduced dimensions with length `1`.

public Output<TString> output ()

Has shape equal to that of the input with reduced dimensions removed or set to `1` depending on `keep_dims`.

public static ReduceJoin.Options separator (String separator)

Parameters
separator The separator to use when joining.