将所有字符串连接成一个字符串,或沿轴连接。
用法
tf.compat.v1.reduce_join(
inputs, axis=None, keep_dims=None, separator='', name=None,
reduction_indices=None, keepdims=None
)
参数
-
inputs
tf.string
张量。 -
axis
沿着哪个轴加入。默认行为是连接所有元素,产生一个标量。 -
keepdims
如果为真,则保留长度为 1 的缩减维度。 -
separator
在每个要连接的字符串之间添加一个字符串。 -
name
操作的名称(可选)。
返回
-
tf.string
张量。
这是按元素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)
相关用法
- Python tf.compat.v1.reduce_sum用法及代码示例
- Python tf.compat.v1.reduce_any用法及代码示例
- Python tf.compat.v1.reduce_max用法及代码示例
- Python tf.compat.v1.reduce_min用法及代码示例
- Python tf.compat.v1.reduce_all用法及代码示例
- Python tf.compat.v1.reduce_prod用法及代码示例
- Python tf.compat.v1.reduce_logsumexp用法及代码示例
- Python tf.compat.v1.reduce_mean用法及代码示例
- Python tf.compat.v1.reverse_sequence用法及代码示例
- Python tf.compat.v1.random.stateless_multinomial用法及代码示例
- Python tf.compat.v1.random_uniform_initializer.from_config用法及代码示例
- Python tf.compat.v1.ragged.constant_value用法及代码示例
- Python tf.compat.v1.random_normal_initializer用法及代码示例
- Python tf.compat.v1.random_normal_initializer.from_config用法及代码示例
- Python tf.compat.v1.random_poisson用法及代码示例
- Python tf.compat.v1.random_uniform_initializer用法及代码示例
- Python tf.compat.v1.distributions.Multinomial.stddev用法及代码示例
- Python tf.compat.v1.distribute.MirroredStrategy.experimental_distribute_dataset用法及代码示例
- Python tf.compat.v1.data.TFRecordDataset.interleave用法及代码示例
- Python tf.compat.v1.distributions.Bernoulli.cross_entropy用法及代码示例
注:本文由纯净天空筛选整理自tensorflow.org大神的英文原创作品 tf.compat.v1.reduce_join。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。