用鏡像值填充張量。
用法
tf.raw_ops.MirrorPad(
input, paddings, mode, name=None
)參數
-
input一個Tensor。要填充的輸入張量。 -
paddings一個Tensor。必須是以下類型之一:int32,int64。指定填充大小的two-column 矩陣。行數必須與input的等級相同。 -
modestring來自:"REFLECT", "SYMMETRIC"。REFLECT或SYMMETRIC。在反射模式中,填充區域不包括邊界,而在對稱模式中,填充區域確實包括邊界。例如,如果input是[1, 2, 3]並且paddings是[0, 2],那麽在反射模式下輸出是[1, 2, 3, 2, 1],在對稱模式下輸出是[1, 2, 3, 3, 2]。 -
name操作的名稱(可選)。
返回
-
一個
Tensor。具有與input相同的類型。
此操作根據您指定的 paddings 使用鏡像值填充 input。 paddings 是形狀為 [n, 2] 的整數張量,其中 n 是 input 的秩。對於每個維度,input , paddings[D, 0]的D表示該維度中input的內容之前要添加多少個值,paddings[D, 1]表示該維度中input的內容之後要添加多少個值。如果 copy_border 為真(如果分別為假),則 paddings[D, 0] 和 paddings[D, 1] 都不得大於 input.dim_size(D)(或 input.dim_size(D) - 1 )。
輸出的每個維度 D 的填充大小為:
paddings(D, 0) + input.dim_size(D) + paddings(D, 1)
例如:
# 't' is [[1, 2, 3], [4, 5, 6]].
# 'paddings' is [[1, 1]], [2, 2]].
# 'mode' is SYMMETRIC.
# rank of 't' is 2.
pad(t, paddings) ==> [[2, 1, 1, 2, 3, 3, 2]
[2, 1, 1, 2, 3, 3, 2]
[5, 4, 4, 5, 6, 6, 5]
[5, 4, 4, 5, 6, 6, 5]]
相關用法
- Python tf.raw_ops.MirrorPadGrad用法及代碼示例
- Python tf.raw_ops.Minimum用法及代碼示例
- Python tf.raw_ops.MutexLock用法及代碼示例
- Python tf.raw_ops.Maximum用法及代碼示例
- Python tf.raw_ops.MatrixDiagPart用法及代碼示例
- Python tf.raw_ops.MatrixDiag用法及代碼示例
- Python tf.raw_ops.MatrixSetDiagV2用法及代碼示例
- Python tf.raw_ops.MatrixDiagV2用法及代碼示例
- Python tf.raw_ops.MatrixDiagV3用法及代碼示例
- Python tf.raw_ops.MatrixSetDiagV3用法及代碼示例
- Python tf.raw_ops.MatrixTriangularSolve用法及代碼示例
- Python tf.raw_ops.MatrixDiagPartV3用法及代碼示例
- Python tf.raw_ops.MatrixDiagPartV2用法及代碼示例
- Python tf.raw_ops.MatrixBandPart用法及代碼示例
- 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用法及代碼示例
注:本文由純淨天空篩選整理自tensorflow.org大神的英文原創作品 tf.raw_ops.MirrorPad。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。
