|
|
|
@ -737,14 +737,51 @@ where ho/wo is do = (output_d + 2*padding_d - dilation_d*(kernel_d - 1) - 1)//st
|
|
|
|
|
* Compatible with Pytorch col2im/im2col_backward operator.
|
|
|
|
|
*/
|
|
|
|
|
REG_OP(Col2im)
|
|
|
|
|
.INPUT(x, TensorType({DT_FLOAT}))
|
|
|
|
|
.INPUT(output_size, TensorType({DT_INT32}))
|
|
|
|
|
.OUTPUT(y, TensorType({DT_FLOAT}))
|
|
|
|
|
.INPUT(x, TensorType({DT_FLOAT, DT_FLOAT16}))
|
|
|
|
|
.INPUT(output_size, TensorType({DT_INT32, DT_INT32}))
|
|
|
|
|
.OUTPUT(y, TensorType({DT_FLOAT, DT_FLOAT16}))
|
|
|
|
|
.REQUIRED_ATTR(kernel_size, ListInt)
|
|
|
|
|
.REQUIRED_ATTR(dilation, ListInt)
|
|
|
|
|
.REQUIRED_ATTR(padding, ListInt)
|
|
|
|
|
.REQUIRED_ATTR(stride, ListInt)
|
|
|
|
|
.OP_END_FACTORY_REG(Col2im)
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
*@brief Generates a 2D or 3D flow field (sampling grid), given a batch of affine
|
|
|
|
|
matrices theta. \n
|
|
|
|
|
|
|
|
|
|
*@par Inputs:
|
|
|
|
|
*Input theta must be float16 or float, output_size must be int32 type.Inputs
|
|
|
|
|
include:
|
|
|
|
|
*@li theta: input batch of affine matrices with shape (N,2,3) for 2D or (N,3,4)
|
|
|
|
|
for 3D
|
|
|
|
|
*@li output_size: the target output image size. (N×C×H×W for 2D or N×C×D×H×W for
|
|
|
|
|
3D) Example: torch.Size((32, 3, 24, 24)) . \n
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
*@par Attributes:
|
|
|
|
|
*align_corners: if True, consider -1 and 1 to refer to the centers of the corner
|
|
|
|
|
pixels rather than the image corners.Refer to grid_sample() for a more complete
|
|
|
|
|
description. A grid generated by affine_grid() should be passed to grid_sample()
|
|
|
|
|
with the same setting for this option. Default: False \n
|
|
|
|
|
|
|
|
|
|
*@par Outputs:
|
|
|
|
|
*@li y: A 2-D integer tensor of shape [M] representing the
|
|
|
|
|
selected indices from the boxes tensor, where M <= max_output_size. \n
|
|
|
|
|
|
|
|
|
|
*@attention Constraints:
|
|
|
|
|
*Input theta must be float16 or float, output_size must be int32 type . \n
|
|
|
|
|
|
|
|
|
|
*@par Third-party framework compatibility
|
|
|
|
|
*Compatible with Pytorch affine_grid operator.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
REG_OP(AffineGrid)
|
|
|
|
|
.INPUT(theta, TensorType({DT_FLOAT16, DT_FLOAT}))
|
|
|
|
|
.INPUT(output_size, TensorType({DT_INT32}))
|
|
|
|
|
.OUTPUT(y, TensorType({DT_FLOAT16, DT_FLOAT}))
|
|
|
|
|
.ATTR(align_corners, Bool, false)
|
|
|
|
|
.OP_END_FACTORY_REG(AffineGrid)
|
|
|
|
|
} // namespace ge
|
|
|
|
|
|
|
|
|
|
#endif // OPS_BUILT_IN_OP_PROTO_INC_TRANSFORMATION_OPS_H_
|
|
|
|
|