基於 segment_ids
加入 inputs
的元素。
用法
tf.raw_ops.UnsortedSegmentJoin(
inputs, segment_ids, num_segments, separator='', name=None
)
參數
-
inputs
Tensor
類型為string
。要加入的輸入。 -
segment_ids
一個Tensor
。必須是以下類型之一:int32
,int64
。一個張量,其形狀是 data.shape 的前綴。不支持負分段 ID。 -
num_segments
一個Tensor
。必須是以下類型之一:int32
,int64
。一個標量。 -
separator
可選的string
。默認為""
。加入時使用的分隔符。 -
name
操作的名稱(可選)。
返回
-
Tensor
類型為string
。
計算沿張量段的字符串連接。給定 segment_ids
排名為 N
和 data
排名為 N+M
:
`output[i, k1...kM] = strings.join([data[j1...jN, k1...kM])`
連接在所有 [j1...jN] 上,使得 segment_ids[j1...jN] = i。字符串以行優先順序連接。
例如:
inputs = [['Y', 'q', 'c'], ['Y', '6', '6'], ['p', 'G', 'a']]
output_array = string_ops.unsorted_segment_join(inputs=inputs,
segment_ids=[1, 0, 1],
num_segments=2,
separator=':'))
# output_array ==> [['Y', '6', '6'], ['Y:p', 'q:G', 'c:a']]
inputs = ['this', 'is', 'a', 'test']
output_array = string_ops.unsorted_segment_join(inputs=inputs,
segment_ids=[0, 0, 0, 0],
num_segments=1,
separator=':'))
# output_array ==> ['this:is:a:test']
相關用法
- Python tf.raw_ops.UnsortedSegmentProd用法及代碼示例
- Python tf.raw_ops.UnsortedSegmentSum用法及代碼示例
- Python tf.raw_ops.UnsortedSegmentMin用法及代碼示例
- Python tf.raw_ops.UnsortedSegmentMax用法及代碼示例
- Python tf.raw_ops.UniqueWithCounts用法及代碼示例
- Python tf.raw_ops.UnicodeScript用法及代碼示例
- Python tf.raw_ops.UniqueV2用法及代碼示例
- Python tf.raw_ops.Unique用法及代碼示例
- Python tf.raw_ops.UnicodeTranscode用法及代碼示例
- Python tf.raw_ops.UnicodeEncode用法及代碼示例
- Python tf.raw_ops.UnravelIndex用法及代碼示例
- Python tf.raw_ops.UniqueWithCountsV2用法及代碼示例
- Python tf.raw_ops.TPUReplicatedInput用法及代碼示例
- Python tf.raw_ops.Bitcast用法及代碼示例
- Python tf.raw_ops.SelfAdjointEigV2用法及代碼示例
- Python tf.raw_ops.BatchMatMul用法及代碼示例
- Python tf.raw_ops.OneHot用法及代碼示例
- Python tf.raw_ops.ResourceScatterNdSub用法及代碼示例
- Python tf.raw_ops.ReadVariableXlaSplitND用法及代碼示例
- Python tf.raw_ops.GatherV2用法及代碼示例
注:本文由純淨天空篩選整理自tensorflow.org大神的英文原創作品 tf.raw_ops.UnsortedSegmentJoin。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。