已合并
fix(op_graph): 5 个算子原型头补 OPS_PROTO_DEF 隔离宏 #5066
zl_hw创建于 8月25日
fix(op_graph): 5 个算子原型头补 OPS_PROTO_DEF 隔离宏 #5066
已合并
共 5 个文件变更+15-0
| @@ -35,6 +35,8 @@ namespace ge { | |||
| 35 | * @par Outputs: | 35 | * @par Outputs: |
| 36 | * y: A Tensor. Has the same type and shape as "x". | 36 | * y: A Tensor. Has the same type and shape as "x". |
| 37 | */ | 37 | */ |
| 38 | + | ||
| 39 | + | ||
| 38 | REG_OP(CumulativeLogsumexp) | 40 | REG_OP(CumulativeLogsumexp) |
| 39 | .INPUT(x, TensorType({DT_FLOAT, DT_FLOAT16})) | 41 | .INPUT(x, TensorType({DT_FLOAT, DT_FLOAT16})) |
| 40 | .INPUT(axis, TensorType({DT_INT32, DT_INT64, DT_INT16})) | 42 | .INPUT(axis, TensorType({DT_INT32, DT_INT64, DT_INT16})) |
| @@ -42,6 +44,7 @@ REG_OP(CumulativeLogsumexp) | |||
| 42 | .ATTR(exclusive, Bool, false) | 44 | .ATTR(exclusive, Bool, false) |
| 43 | .ATTR(reverse, Bool, false) | 45 | .ATTR(reverse, Bool, false) |
| 44 | .OP_END_FACTORY_REG(CumulativeLogsumexp) | 46 | .OP_END_FACTORY_REG(CumulativeLogsumexp) |
| 47 | + | ||
| 45 | } // namespace ge | 48 | } // namespace ge |
| 46 | 49 | ||
| 47 | 50 | ||
| @@ -35,12 +35,15 @@ namespace ge { | |||
| 35 | * @par Third-party framework compatibility | 35 | * @par Third-party framework compatibility |
| 36 | * Compatible with TensorFlow/PyTorch graph fusion of Mul followed by Add. | 36 | * Compatible with TensorFlow/PyTorch graph fusion of Mul followed by Add. |
| 37 | */ | 37 | */ |
| 38 | + | ||
| 39 | + | ||
| 38 | REG_OP(FusedMulAdd) | 40 | REG_OP(FusedMulAdd) |
| 39 | .INPUT(x1, TensorType({DT_FLOAT16, DT_FLOAT, DT_INT32})) | 41 | .INPUT(x1, TensorType({DT_FLOAT16, DT_FLOAT, DT_INT32})) |
| 40 | .INPUT(x2, TensorType({DT_FLOAT16, DT_FLOAT, DT_INT32})) | 42 | .INPUT(x2, TensorType({DT_FLOAT16, DT_FLOAT, DT_INT32})) |
| 41 | .INPUT(x3, TensorType({DT_FLOAT16, DT_FLOAT, DT_INT32})) | 43 | .INPUT(x3, TensorType({DT_FLOAT16, DT_FLOAT, DT_INT32})) |
| 42 | .OUTPUT(y, TensorType({DT_FLOAT16, DT_FLOAT, DT_INT32})) | 44 | .OUTPUT(y, TensorType({DT_FLOAT16, DT_FLOAT, DT_INT32})) |
| 43 | .OP_END_FACTORY_REG(FusedMulAdd) | 45 | .OP_END_FACTORY_REG(FusedMulAdd) |
| 46 | + | ||
| 44 | 47 | ||
| 45 | } // namespace ge | 48 | } // namespace ge |
| 46 | 49 | ||
| @@ -44,6 +44,8 @@ namespace ge { | |||
| 44 | * Compatible with the graph fusion of Mul followed by two Add operators | 44 | * Compatible with the graph fusion of Mul followed by two Add operators |
| 45 | * (e.g. BatchMatmul + bias + residual patterns). | 45 | * (e.g. BatchMatmul + bias + residual patterns). |
| 46 | */ | 46 | */ |
| 47 | + | ||
| 48 | + | ||
| 47 | REG_OP(FusedMulAddAdd) | 49 | REG_OP(FusedMulAddAdd) |
| 48 | .INPUT(x1, TensorType({DT_FLOAT16, DT_FLOAT, DT_INT32})) | 50 | .INPUT(x1, TensorType({DT_FLOAT16, DT_FLOAT, DT_INT32})) |
| 49 | .INPUT(x2, TensorType({DT_FLOAT16, DT_FLOAT, DT_INT32})) | 51 | .INPUT(x2, TensorType({DT_FLOAT16, DT_FLOAT, DT_INT32})) |
| @@ -51,6 +53,7 @@ REG_OP(FusedMulAddAdd) | |||
| 51 | .INPUT(x4, TensorType({DT_FLOAT16, DT_FLOAT, DT_INT32})) | 53 | .INPUT(x4, TensorType({DT_FLOAT16, DT_FLOAT, DT_INT32})) |
| 52 | .OUTPUT(y, TensorType({DT_FLOAT16, DT_FLOAT, DT_INT32})) | 54 | .OUTPUT(y, TensorType({DT_FLOAT16, DT_FLOAT, DT_INT32})) |
| 53 | .OP_END_FACTORY_REG(FusedMulAddAdd) | 55 | .OP_END_FACTORY_REG(FusedMulAddAdd) |
| 56 | + | ||
| 54 | 57 | ||
| 55 | } // namespace ge | 58 | } // namespace ge |
| 56 | 59 | ||
| @@ -36,6 +36,8 @@ namespace ge { | |||
| 36 | * @par Third-party framework compatibility | 36 | * @par Third-party framework compatibility |
| 37 | * Compatible with the fused Mul + AddN + L2Loss subgraph. | 37 | * Compatible with the fused Mul + AddN + L2Loss subgraph. |
| 38 | */ | 38 | */ |
| 39 | + | ||
| 40 | + | ||
| 39 | REG_OP(FusedMulAddNL2loss) | 41 | REG_OP(FusedMulAddNL2loss) |
| 40 | .INPUT(x1, TensorType::NumberType()) | 42 | .INPUT(x1, TensorType::NumberType()) |
| 41 | .INPUT(x2, TensorType::NumberType()) | 43 | .INPUT(x2, TensorType::NumberType()) |
| @@ -43,6 +45,7 @@ REG_OP(FusedMulAddNL2loss) | |||
| 43 | .OUTPUT(y1, TensorType::NumberType()) | 45 | .OUTPUT(y1, TensorType::NumberType()) |
| 44 | .OUTPUT(y2, TensorType::NumberType()) | 46 | .OUTPUT(y2, TensorType::NumberType()) |
| 45 | .OP_END_FACTORY_REG(FusedMulAddNL2loss) | 47 | .OP_END_FACTORY_REG(FusedMulAddNL2loss) |
| 48 | + | ||
| 46 | 49 | ||
| 47 | } // namespace ge | 50 | } // namespace ge |
| 48 | 51 | ||
| @@ -38,11 +38,14 @@ namespace ge { | |||
| 38 | * @par Third-party framework compatibility | 38 | * @par Third-party framework compatibility |
| 39 | * Compatible with the TensorFlow operator MulNoNan (tf.math.multiply_no_nans). | 39 | * Compatible with the TensorFlow operator MulNoNan (tf.math.multiply_no_nans). |
| 40 | */ | 40 | */ |
| 41 | + | ||
| 42 | + | ||
| 41 | REG_OP(MulNoNan) | 43 | REG_OP(MulNoNan) |
| 42 | .INPUT(x1, TensorType({DT_FLOAT16, DT_FLOAT, DT_INT32, DT_BF16})) | 44 | .INPUT(x1, TensorType({DT_FLOAT16, DT_FLOAT, DT_INT32, DT_BF16})) |
| 43 | .INPUT(x2, TensorType({DT_FLOAT16, DT_FLOAT, DT_INT32, DT_BF16})) | 45 | .INPUT(x2, TensorType({DT_FLOAT16, DT_FLOAT, DT_INT32, DT_BF16})) |
| 44 | .OUTPUT(y, TensorType({DT_FLOAT16, DT_FLOAT, DT_INT32, DT_BF16})) | 46 | .OUTPUT(y, TensorType({DT_FLOAT16, DT_FLOAT, DT_INT32, DT_BF16})) |
| 45 | .OP_END_FACTORY_REG(MulNoNan) | 47 | .OP_END_FACTORY_REG(MulNoNan) |
| 48 | + | ||
| 46 | 49 | ||
| 47 | } // namespace ge | 50 | } // namespace ge |
| 48 | 51 | ||