用镜像值填充张量。
用法
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。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。
