已合并
fix(op_graph): 5 个算子原型头补 OPS_PROTO_DEF 隔离宏 #5066
fix(op_graph): 5 个算子原型头补 OPS_PROTO_DEF 隔离宏 #5066
已合并
zl_hw创建于 8月25日
共 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+#ifndef OPS_PROTO_DEF_CUMULATIVELOGSUMEXP
39+#define OPS_PROTO_DEF_CUMULATIVELOGSUMEXP
38REG_OP(CumulativeLogsumexp)40REG_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+#endif // OPS_PROTO_DEF_CUMULATIVELOGSUMEXP
45} // namespace ge48} // namespace ge
46 49 
47#endif50#endif
@@ -35,12 +35,15 @@ namespace ge {
35* @par Third-party framework compatibility35* @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+#ifndef OPS_PROTO_DEF_FUSEDMULADD
39+#define OPS_PROTO_DEF_FUSEDMULADD
38REG_OP(FusedMulAdd)40REG_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+#endif // OPS_PROTO_DEF_FUSEDMULADD
44 47 
45} // namespace ge48} // namespace ge
46 49 
@@ -44,6 +44,8 @@ namespace ge {
44* Compatible with the graph fusion of Mul followed by two Add operators44* 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+#ifndef OPS_PROTO_DEF_FUSEDMULADDADD
48+#define OPS_PROTO_DEF_FUSEDMULADDADD
47REG_OP(FusedMulAddAdd)49REG_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+#endif // OPS_PROTO_DEF_FUSEDMULADDADD
54 57 
55} // namespace ge58} // namespace ge
56 59 
@@ -36,6 +36,8 @@ namespace ge {
36* @par Third-party framework compatibility36* @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+#ifndef OPS_PROTO_DEF_FUSEDMULADDNL2LOSS
40+#define OPS_PROTO_DEF_FUSEDMULADDNL2LOSS
39REG_OP(FusedMulAddNL2loss)41REG_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+#endif // OPS_PROTO_DEF_FUSEDMULADDNL2LOSS
46 49 
47} // namespace ge50} // namespace ge
48 51 
@@ -38,11 +38,14 @@ namespace ge {
38* @par Third-party framework compatibility38* @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+#ifndef OPS_PROTO_DEF_MULNONAN
42+#define OPS_PROTO_DEF_MULNONAN
41REG_OP(MulNoNan)43REG_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+#endif // OPS_PROTO_DEF_MULNONAN
46 49 
47} // namespace ge50} // namespace ge
48 51