tf.strings.reduce_join
Stay organized with collections
Save and categorize content based on your preferences.
Joins all strings into a single string, or joins along an axis.
tf.strings.reduce_join(
inputs, axis=None, keepdims=False, separator='', name=None
)
This is the reduction operation for the elementwise tf.strings.join
op.
tf.strings.reduce_join([['abc','123'],
['def','456']]).numpy()
b'abc123def456'
tf.strings.reduce_join([['abc','123'],
['def','456']], axis=-1).numpy()
array([b'abc123', b'def456'], dtype=object)
tf.strings.reduce_join([['abc','123'],
['def','456']],
axis=-1,
separator=" ").numpy()
array([b'abc 123', b'def 456'], dtype=object)
Args |
inputs
|
A tf.string tensor.
|
axis
|
Which axis to join along. The default behavior is to join all
elements, producing a scalar.
|
keepdims
|
If true, retains reduced dimensions with length 1.
|
separator
|
a string added between each string being joined.
|
name
|
A name for the operation (optional).
|
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 2023-10-06 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 2023-10-06 UTC."],[],[]]