tf.raw_ops.ReduceJoin
bookmark_borderbookmark
Stay organized with collections
Save and categorize content based on your preferences.
Joins a string Tensor across the given dimensions.
View aliases
Compat aliases for migration
See
Migration guide for
more details.
tf.compat.v1.raw_ops.ReduceJoin
tf.raw_ops.ReduceJoin(
inputs,
reduction_indices,
keep_dims=False,
separator='',
name=None
)
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"
Args |
inputs
|
A Tensor of type string .
The input to be joined. All reduced indices must have non-zero size.
|
reduction_indices
|
A Tensor of type int32 .
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.
|
keep_dims
|
An optional bool . Defaults to False .
If True , retain reduced dimensions with length 1 .
|
separator
|
An optional string . Defaults to "" .
The separator to use when joining.
|
name
|
A name for the operation (optional).
|
Returns |
A Tensor of type string .
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates. Some content is licensed under the numpy license.
Last updated 2024-04-26 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-04-26 UTC."],[],[],null,["# tf.raw_ops.ReduceJoin\n\nJoins a string Tensor across the given dimensions.\n\n#### View aliases\n\n\n**Compat aliases for migration**\n\nSee\n[Migration guide](https://www.tensorflow.org/guide/migrate) for\nmore details.\n\n[`tf.compat.v1.raw_ops.ReduceJoin`](https://www.tensorflow.org/api_docs/python/tf/raw_ops/ReduceJoin)\n\n\u003cbr /\u003e\n\n tf.raw_ops.ReduceJoin(\n inputs,\n reduction_indices,\n keep_dims=False,\n separator='',\n name=None\n )\n\nComputes the string join across dimensions in the given string Tensor of shape\n`[\\\\(d_0, d_1, ..., d_{n-1}\\\\)]`. Returns a new Tensor created by joining the input\nstrings with the given separator (default: empty string). Negative indices are\ncounted backwards from the end, with `-1` being equivalent to `n - 1`. If\nindices are not specified, joins across all dimensions beginning from `n - 1`\nthrough `0`.\n\n#### For example:\n\n # tensor `a` is [[\"a\", \"b\"], [\"c\", \"d\"]]\n tf.reduce_join(a, 0) ==\u003e [\"ac\", \"bd\"]\n tf.reduce_join(a, 1) ==\u003e [\"ab\", \"cd\"]\n tf.reduce_join(a, -2) = tf.reduce_join(a, 0) ==\u003e [\"ac\", \"bd\"]\n tf.reduce_join(a, -1) = tf.reduce_join(a, 1) ==\u003e [\"ab\", \"cd\"]\n tf.reduce_join(a, 0, keep_dims=True) ==\u003e [[\"ac\", \"bd\"]]\n tf.reduce_join(a, 1, keep_dims=True) ==\u003e [[\"ab\"], [\"cd\"]]\n tf.reduce_join(a, 0, separator=\".\") ==\u003e [\"a.c\", \"b.d\"]\n tf.reduce_join(a, [0, 1]) ==\u003e \"acbd\"\n tf.reduce_join(a, [1, 0]) ==\u003e \"abcd\"\n tf.reduce_join(a, []) ==\u003e [[\"a\", \"b\"], [\"c\", \"d\"]]\n tf.reduce_join(a) = tf.reduce_join(a, [1, 0]) ==\u003e \"abcd\"\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ---- ||\n|---------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `inputs` | A `Tensor` of type `string`. The input to be joined. All reduced indices must have non-zero size. |\n| `reduction_indices` | A `Tensor` of type `int32`. 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. |\n| `keep_dims` | An optional `bool`. Defaults to `False`. If `True`, retain reduced dimensions with length `1`. |\n| `separator` | An optional `string`. Defaults to `\"\"`. The separator to use when joining. |\n| `name` | A name for the operation (optional). |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ------- ||\n|---|---|\n| A `Tensor` of type `string`. ||\n\n\u003cbr /\u003e"]]