已合并
池化类算子proto新增宏隔离 #8435
小王!创建于 24 天前
池化类算子proto新增宏隔离 #8435
已合并
共 9 个文件变更+32-5
| @@ -39,11 +39,14 @@ namespace ge { | |||
| 39 | * @par Third-party framework compatibility | 39 | * @par Third-party framework compatibility |
| 40 | * Compatible with the Pytorch operator AdaptiveAvgPool2d. | 40 | * Compatible with the Pytorch operator AdaptiveAvgPool2d. |
| 41 | */ | 41 | */ |
| 42 | + | ||
| 43 | + | ||
| 42 | REG_OP(AdaptiveAvgPool2d) | 44 | REG_OP(AdaptiveAvgPool2d) |
| 43 | .INPUT(x, TensorType({DT_FLOAT, DT_FLOAT16, DT_BF16})) | 45 | .INPUT(x, TensorType({DT_FLOAT, DT_FLOAT16, DT_BF16})) |
| 44 | .OUTPUT(y, TensorType({DT_FLOAT, DT_FLOAT16, DT_BF16})) | 46 | .OUTPUT(y, TensorType({DT_FLOAT, DT_FLOAT16, DT_BF16})) |
| 45 | .REQUIRED_ATTR(output_size, ListInt) | 47 | .REQUIRED_ATTR(output_size, ListInt) |
| 46 | .OP_END_FACTORY_REG(AdaptiveAvgPool2d) | 48 | .OP_END_FACTORY_REG(AdaptiveAvgPool2d) |
| 49 | + | ||
| 47 | } // namespace ge | 50 | } // namespace ge |
| 48 | 51 | ||
| 49 | -#endif // OPS_POOLING_ADAPTIVE_AVG_POOL2D_PROTO_H_ | 52 | +#endif // OPS_POOLING_ADAPTIVE_AVG_POOL2D_PROTO_H_ |
| @@ -35,11 +35,14 @@ namespace ge { | |||
| 35 | * @par Third-party framework compatibility | 35 | * @par Third-party framework compatibility |
| 36 | * Compatible with the Pytorch operator AdaptiveAvgPool2dGrad. | 36 | * Compatible with the Pytorch operator AdaptiveAvgPool2dGrad. |
| 37 | */ | 37 | */ |
| 38 | + | ||
| 39 | + | ||
| 38 | REG_OP(AdaptiveAvgPool2dGrad) | 40 | REG_OP(AdaptiveAvgPool2dGrad) |
| 39 | .INPUT(input_grad, TensorType({DT_FLOAT, DT_FLOAT16, DT_BF16})) | 41 | .INPUT(input_grad, TensorType({DT_FLOAT, DT_FLOAT16, DT_BF16})) |
| 40 | .OUTPUT(output_grad, TensorType({DT_FLOAT, DT_FLOAT16, DT_BF16})) | 42 | .OUTPUT(output_grad, TensorType({DT_FLOAT, DT_FLOAT16, DT_BF16})) |
| 41 | .REQUIRED_ATTR(orig_input_shape, ListInt) | 43 | .REQUIRED_ATTR(orig_input_shape, ListInt) |
| 42 | .OP_END_FACTORY_REG(AdaptiveAvgPool2dGrad) | 44 | .OP_END_FACTORY_REG(AdaptiveAvgPool2dGrad) |
| 45 | + | ||
| 43 | 46 | ||
| 44 | } // namespace ge | 47 | } // namespace ge |
| 45 | 48 | ||
| @@ -51,6 +51,8 @@ namespace ge { | |||
| 51 | * @par Third-party framework compatibility | 51 | * @par Third-party framework compatibility |
| 52 | * @li Compatible with the TensorFlow operator AvgPoolGrad. | 52 | * @li Compatible with the TensorFlow operator AvgPoolGrad. |
| 53 | */ | 53 | */ |
| 54 | + | ||
| 55 | + | ||
| 54 | REG_OP(AvgPoolGrad) | 56 | REG_OP(AvgPoolGrad) |
| 55 | .INPUT(orig_input_shape, TensorType({DT_INT32})) | 57 | .INPUT(orig_input_shape, TensorType({DT_INT32})) |
| 56 | .INPUT(input_grad, TensorType({DT_FLOAT16, DT_FLOAT32, DT_DOUBLE, DT_BF16})) | 58 | .INPUT(input_grad, TensorType({DT_FLOAT16, DT_FLOAT32, DT_DOUBLE, DT_BF16})) |
| @@ -60,6 +62,7 @@ REG_OP(AvgPoolGrad) | |||
| 60 | .REQUIRED_ATTR(padding, String) | 62 | .REQUIRED_ATTR(padding, String) |
| 61 | .ATTR(data_format, String, "NHWC") | 63 | .ATTR(data_format, String, "NHWC") |
| 62 | .OP_END_FACTORY_REG(AvgPoolGrad) | 64 | .OP_END_FACTORY_REG(AvgPoolGrad) |
| 65 | + | ||
| 63 | 66 | ||
| 64 | } // namespace ge | 67 | } // namespace ge |
| 65 | 68 | ||
| @@ -60,6 +60,8 @@ namespace ge { | |||
| 60 | * @par Third-party framework compatibility | 60 | * @par Third-party framework compatibility |
| 61 | * @li Compatible with the TensorFlow operator AvgPoolGrad. | 61 | * @li Compatible with the TensorFlow operator AvgPoolGrad. |
| 62 | */ | 62 | */ |
| 63 | + | ||
| 64 | + | ||
| 63 | REG_OP(AvgPoolV2Grad) | 65 | REG_OP(AvgPoolV2Grad) |
| 64 | .INPUT(orig_input_shape, TensorType({DT_INT32})) | 66 | .INPUT(orig_input_shape, TensorType({DT_INT32})) |
| 65 | .INPUT(input_grad, TensorType({DT_FLOAT16, DT_FLOAT32, DT_DOUBLE, DT_BF16})) | 67 | .INPUT(input_grad, TensorType({DT_FLOAT16, DT_FLOAT32, DT_DOUBLE, DT_BF16})) |
| @@ -74,6 +76,7 @@ REG_OP(AvgPoolV2Grad) | |||
| 74 | .ATTR(exclusive, Bool, true) | 76 | .ATTR(exclusive, Bool, true) |
| 75 | .ATTR(divisor_override, Int, 0) | 77 | .ATTR(divisor_override, Int, 0) |
| 76 | .OP_END_FACTORY_REG(AvgPoolV2Grad) | 78 | .OP_END_FACTORY_REG(AvgPoolV2Grad) |
| 79 | + | ||
| 77 | 80 | ||
| 78 | } // namespace ge | 81 | } // namespace ge |
| 79 | -#endif // OP_PROTO_AVG_POOL_V2_GRAD_H_ | 82 | +#endif // OP_PROTO_AVG_POOL_V2_GRAD_H_ |
| @@ -59,6 +59,8 @@ and VALID. | |||
| 59 | * @par Third-party framework compatibility | 59 | * @par Third-party framework compatibility |
| 60 | * Compatible with the Torch operator MaxPool3DGrad. | 60 | * Compatible with the Torch operator MaxPool3DGrad. |
| 61 | */ | 61 | */ |
| 62 | + | ||
| 63 | + | ||
| 62 | REG_OP(MaxPool3DGrad) | 64 | REG_OP(MaxPool3DGrad) |
| 63 | .INPUT(orig_x, TensorType::RealNumberType()) | 65 | .INPUT(orig_x, TensorType::RealNumberType()) |
| 64 | .INPUT(orig_y, TensorType::RealNumberType()) | 66 | .INPUT(orig_y, TensorType::RealNumberType()) |
| @@ -70,5 +72,6 @@ REG_OP(MaxPool3DGrad) | |||
| 70 | .REQUIRED_ATTR(pads, ListInt) | 72 | .REQUIRED_ATTR(pads, ListInt) |
| 71 | .ATTR(data_format, String, "NDHWC") | 73 | .ATTR(data_format, String, "NDHWC") |
| 72 | .OP_END_FACTORY_REG(MaxPool3DGrad) | 74 | .OP_END_FACTORY_REG(MaxPool3DGrad) |
| 75 | + | ||
| 73 | } // namespace ge | 76 | } // namespace ge |
| 74 | 77 | ||
| @@ -61,6 +61,8 @@ mask. | |||
| 61 | * Compatible with the PyTorch backward operator of max_pool2d_with_indices. | 61 | * Compatible with the PyTorch backward operator of max_pool2d_with_indices. |
| 62 | */ | 62 | */ |
| 63 | 63 | ||
| 64 | + | ||
| 65 | + | ||
| 64 | REG_OP(MaxPoolGradWithArgmaxV1) | 66 | REG_OP(MaxPoolGradWithArgmaxV1) |
| 65 | .INPUT(x, TensorType({DT_FLOAT16, DT_FLOAT})) | 67 | .INPUT(x, TensorType({DT_FLOAT16, DT_FLOAT})) |
| 66 | .INPUT(grad, TensorType({DT_FLOAT16, DT_FLOAT})) | 68 | .INPUT(grad, TensorType({DT_FLOAT16, DT_FLOAT})) |
| @@ -73,5 +75,6 @@ REG_OP(MaxPoolGradWithArgmaxV1) | |||
| 73 | .ATTR(dilation, ListInt, {1, 1, 1, 1}) | 75 | .ATTR(dilation, ListInt, {1, 1, 1, 1}) |
| 74 | .ATTR(ceil_mode, Bool, false) | 76 | .ATTR(ceil_mode, Bool, false) |
| 75 | .OP_END_FACTORY_REG(MaxPoolGradWithArgmaxV1) | 77 | .OP_END_FACTORY_REG(MaxPoolGradWithArgmaxV1) |
| 78 | + | ||
| 76 | } // namespace ge | 79 | } // namespace ge |
| 77 | -#endif | 80 | +#endif |
| @@ -54,6 +54,8 @@ mask. \n | |||
| 54 | * @par Third-party framework compatibility | 54 | * @par Third-party framework compatibility |
| 55 | * Compatible with the PyTorch operator max_pool2d_with_indices. | 55 | * Compatible with the PyTorch operator max_pool2d_with_indices. |
| 56 | */ | 56 | */ |
| 57 | + | ||
| 58 | + | ||
| 57 | REG_OP(MaxPoolWithArgmaxV1) | 59 | REG_OP(MaxPoolWithArgmaxV1) |
| 58 | .INPUT(x, TensorType({DT_FLOAT16, DT_FLOAT32})) | 60 | .INPUT(x, TensorType({DT_FLOAT16, DT_FLOAT32})) |
| 59 | .OUTPUT(y, TensorType({DT_FLOAT16, DT_FLOAT32})) | 61 | .OUTPUT(y, TensorType({DT_FLOAT16, DT_FLOAT32})) |
| @@ -65,6 +67,7 @@ REG_OP(MaxPoolWithArgmaxV1) | |||
| 65 | .ATTR(dilation, ListInt, {1, 1, 1, 1}) | 67 | .ATTR(dilation, ListInt, {1, 1, 1, 1}) |
| 66 | .ATTR(ceil_mode, Bool, false) | 68 | .ATTR(ceil_mode, Bool, false) |
| 67 | .OP_END_FACTORY_REG(MaxPoolWithArgmaxV1) | 69 | .OP_END_FACTORY_REG(MaxPoolWithArgmaxV1) |
| 70 | + | ||
| 68 | 71 | ||
| 69 | } // namespace ge | 72 | } // namespace ge |
| 70 | -#endif | 73 | +#endif |
| @@ -45,6 +45,8 @@ namespace ge { | |||
| 45 | * @par Third-party framework compatibility | 45 | * @par Third-party framework compatibility |
| 46 | * Compatible with the TensorFlow operator MaxPoolGrad. | 46 | * Compatible with the TensorFlow operator MaxPoolGrad. |
| 47 | */ | 47 | */ |
| 48 | + | ||
| 49 | + | ||
| 48 | REG_OP(MaxPoolGrad) | 50 | REG_OP(MaxPoolGrad) |
| 49 | .INPUT(x1, TensorType::RealNumberType()) | 51 | .INPUT(x1, TensorType::RealNumberType()) |
| 50 | .INPUT(x2, TensorType::RealNumberType()) | 52 | .INPUT(x2, TensorType::RealNumberType()) |
| @@ -55,6 +57,7 @@ REG_OP(MaxPoolGrad) | |||
| 55 | .REQUIRED_ATTR(padding, String) | 57 | .REQUIRED_ATTR(padding, String) |
| 56 | .ATTR(data_format, String, "NHWC") | 58 | .ATTR(data_format, String, "NHWC") |
| 57 | .OP_END_FACTORY_REG(MaxPoolGrad) | 59 | .OP_END_FACTORY_REG(MaxPoolGrad) |
| 60 | + | ||
| 58 | } // namespace ge | 61 | } // namespace ge |
| 59 | 62 | ||
| 60 | 63 | ||
| @@ -61,6 +61,8 @@ namespace ge { | |||
| 61 | * @par Third-party framework compatibility | 61 | * @par Third-party framework compatibility |
| 62 | * Compatible with the TensorFlow operator MaxPool. | 62 | * Compatible with the TensorFlow operator MaxPool. |
| 63 | */ | 63 | */ |
| 64 | + | ||
| 65 | + | ||
| 64 | REG_OP(MaxPool) | 66 | REG_OP(MaxPool) |
| 65 | .INPUT(x, TensorType({DT_FLOAT16, DT_FLOAT32, DT_DOUBLE, DT_INT8, DT_INT16, DT_INT32, DT_INT64, DT_UINT8, DT_UINT16, | 67 | .INPUT(x, TensorType({DT_FLOAT16, DT_FLOAT32, DT_DOUBLE, DT_INT8, DT_INT16, DT_INT32, DT_INT64, DT_UINT8, DT_UINT16, |
| 66 | DT_QINT8})) | 68 | DT_QINT8})) |
| @@ -71,6 +73,7 @@ REG_OP(MaxPool) | |||
| 71 | .REQUIRED_ATTR(padding, String) | 73 | .REQUIRED_ATTR(padding, String) |
| 72 | .ATTR(data_format, String, "NHWC") | 74 | .ATTR(data_format, String, "NHWC") |
| 73 | .OP_END_FACTORY_REG(MaxPool) | 75 | .OP_END_FACTORY_REG(MaxPool) |
| 76 | + | ||
| 74 | 77 | ||
| 75 | } // namespace ge | 78 | } // namespace ge |
| 76 | -#endif | 79 | +#endif |