用零填充張量。
用法
tf.raw_ops.Pad(
input, paddings, name=None
)參數
-
input一個Tensor。 -
paddings一個Tensor。必須是以下類型之一:int32,int64。 -
name操作的名稱(可選)。
返回
-
一個
Tensor。具有與input相同的類型。
此操作根據您指定的 paddings 用零填充 input。 paddings 是形狀為 [Dn, 2] 的整數張量,其中 n 是 input 的秩。對於input , paddings[D, 0]的每個維度D表示該維度中input的內容之前要添加多少個零,而paddings[D, 1]表示該維度中input的內容之後要添加多少個零。
輸出的每個維度 D 的填充大小為:
paddings(D, 0) + input.dim_size(D) + paddings(D, 1)
例如:
# 't' is [[1, 1], [2, 2]]
# 'paddings' is [[1, 1], [2, 2]]
# rank of 't' is 2
pad(t, paddings) ==> [[0, 0, 0, 0, 0, 0]
[0, 0, 1, 1, 0, 0]
[0, 0, 2, 2, 0, 0]
[0, 0, 0, 0, 0, 0]]
相關用法
- Python tf.raw_ops.PadV2用法及代碼示例
- Python tf.raw_ops.ParallelConcat用法及代碼示例
- Python tf.raw_ops.ParseSequenceExampleV2用法及代碼示例
- Python tf.raw_ops.ParallelDynamicStitch用法及代碼示例
- Python tf.raw_ops.Pack用法及代碼示例
- Python tf.raw_ops.Pow用法及代碼示例
- 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用法及代碼示例
- Python tf.raw_ops.Expm1用法及代碼示例
- Python tf.raw_ops.BitwiseAnd用法及代碼示例
- Python tf.raw_ops.UniqueWithCounts用法及代碼示例
- Python tf.raw_ops.DecodeGif用法及代碼示例
- Python tf.raw_ops.Size用法及代碼示例
- Python tf.raw_ops.ScatterUpdate用法及代碼示例
注:本文由純淨天空篩選整理自tensorflow.org大神的英文原創作品 tf.raw_ops.Pad。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。
