Spec-Zone.ru › TensorFlow

tf.strings.join

Perform element-wise concatenation of a list of string tensors.

View aliases

Compat aliases for migration

See Migration guide for more details.

tf.compat.v1.string_join, tf.compat.v1.strings.join

tf.strings.join(
    inputs, separator='', name=None
)

Used in the notebooks

Used in the guide Used in the tutorials
  • Ragged tensors
  • Text generation with an RNN
  • Sending Different Data To Particular Clients With tff.federated_select
  • Client-efficient large-model federated learning via `federated_select` and sparse aggregation
  • Image captioning with visual attention
  • Neural machine translation with attention

Given a list of string tensors of same shape, performs element-wise concatenation of the strings of the same index in all tensors.

tf.strings.join(['abc','def']).numpy()
b'abcdef'
tf.strings.join([['abc','123'],
                 ['def','456'],
                 ['ghi','789']]).numpy()
array([b'abcdefghi', b'123456789'], dtype=object)
tf.strings.join([['abc','123'],
                 ['def','456']],
                 separator=" ").numpy()
array([b'abc def', b'123 456'], dtype=object)

The reduction version of this elementwise operation is tf.strings.reduce_join

Args
inputs A list of tf.Tensor objects of same size and tf.string dtype.
separator A string added between each string being joined.
name A name for the operation (optional).
Returns
A tf.string tensor.

© 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/python/tf/strings/join

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API