W3Cschool
恭喜您成為首批注冊用戶
獲得88經驗值獎勵
tf.reduce_join 函數(shù)
reduce_join(
inputs,
axis=None,
keep_dims=False,
separator='',
name=None,
reduction_indices=None
)
定義在:tensorflow/python/ops/string_ops.py.
參閱指南:字符串操作>連接
在給定的維度上加入一個字符串張量.
在具有給定形狀的 [d_0,d_1,……,d_n-1] 字符串張量中計算跨維度的字符串連接.返回一個新的Tensor,它由輸入字符串與給定的分隔符(默認:空字符串)連接創(chuàng)建的.負的指標從末端向后數(shù),-1相當于n - 1.
例如:
# 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, []) ==> ["abcd"]
參數(shù):
返回:
返回string類型的Tensor.形狀與輸入的形狀相同,減小的維度被移除或設置為1,取決于keep_dims.
Copyright©2021 w3cschool編程獅|閩ICP備15016281號-3|閩公網(wǎng)安備35020302033924號
違法和不良信息舉報電話:173-0602-2364|舉報郵箱:jubao@eeedong.com
掃描二維碼
下載編程獅App
編程獅公眾號
聯(lián)系方式:
更多建議: