跨給定維度連接字符串張量。
用法
tf.raw_ops.ReduceJoin(
inputs, reduction_indices, keep_dims=False, separator='', name=None
)參數
-
inputsTensor類型為string。要加入的輸入。所有縮減的索引必須具有非零大小。 -
reduction_indicesTensor類型為int32。要減少的尺寸。尺寸按指定的順序縮小。省略reduction_indices等同於傳遞[n-1, n-2, ..., 0]。支持從-n到-1的負索引。 -
keep_dims可選的bool。默認為False。如果True,保留長度為1的縮減維度。 -
separator可選的string。默認為""。加入時使用的分隔符。 -
name操作的名稱(可選)。
返回
-
Tensor類型為string。
計算形狀為 [\\(d_0, d_1, ..., d_{n-1}\\)] 的給定字符串張量中跨維度的字符串連接。返回通過使用給定分隔符連接輸入字符串創建的新張量(默認值:空字符串)。負索引從末尾向後計數,-1 等同於 n - 1 。如果未指定索引,則連接從 n - 1 到 0 的所有維度。
例如:
# 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"
相關用法
- Python tf.raw_ops.ResourceScatterNdSub用法及代碼示例
- Python tf.raw_ops.ReadVariableXlaSplitND用法及代碼示例
- Python tf.raw_ops.ResourceScatterMul用法及代碼示例
- Python tf.raw_ops.Real用法及代碼示例
- Python tf.raw_ops.ResourceScatterAdd用法及代碼示例
- Python tf.raw_ops.ResourceScatterMax用法及代碼示例
- Python tf.raw_ops.ResourceScatterMin用法及代碼示例
- Python tf.raw_ops.Relu用法及代碼示例
- Python tf.raw_ops.ReverseV2用法及代碼示例
- Python tf.raw_ops.ResourceGather用法及代碼示例
- Python tf.raw_ops.Reverse用法及代碼示例
- Python tf.raw_ops.Reshape用法及代碼示例
- Python tf.raw_ops.ResourceScatterNdAdd用法及代碼示例
- Python tf.raw_ops.ResourceScatterNdUpdate用法及代碼示例
- Python tf.raw_ops.ResourceScatterSub用法及代碼示例
- Python tf.raw_ops.ResourceScatterUpdate用法及代碼示例
- Python tf.raw_ops.ResourceScatterDiv用法及代碼示例
- Python tf.raw_ops.RegexFullMatch用法及代碼示例
- Python tf.raw_ops.ReverseSequence用法及代碼示例
- Python tf.raw_ops.RaggedGather用法及代碼示例
注:本文由純淨天空篩選整理自tensorflow.org大神的英文原創作品 tf.raw_ops.ReduceJoin。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。
