@@ -1078,23 +1078,30 @@ RegisterOperators logging_operators(
10781078#define DEFINE_BINARY_OP (aten_op, op ) \
10791079 DEFINE_GENERIC_OP (aten_op, op, op, int , float ), \
10801080 DEFINE_INT_FLOAT_OP (aten_op, op, float )
1081+
1082+ #define DEFINE_BINARY_FLOAT_OP (aten_op, op ) \
1083+ DEFINE_GENERIC_OP (aten_op, op, op, float , float ), \
1084+ DEFINE_INT_FLOAT_OP (aten_op, op, float )
1085+
10811086#define DEFINE_COMPARISON_OP (aten_op, op ) \
10821087 DEFINE_GENERIC_OP (aten_op, op, op, bool , bool ), \
10831088 DEFINE_INT_FLOAT_OP (aten_op, op, bool ), DEFINE_STR_CMP_OP(aten_op, op)
10841089
10851090#define DEFINE_UNARY_OP (aten_op, op, int_result, float_result ) \
1086- Operator (#aten_op " (int a) -> " #int_result, [](Stack& stack) { \
1087- int64_t a; \
1088- pop (stack, a); \
1089- push (stack, op); \
1090- return 0 ; \
1091- }), \
1092- Operator (#aten_op " (float a) -> " #float_result, [](Stack& stack) { \
1093- double a; \
1094- pop (stack, a); \
1095- push (stack, op); \
1096- return 0 ; \
1097- })
1091+ Operator ( \
1092+ #aten_op " (int a) -> " #int_result, \
1093+ [](Stack& stack) { \
1094+ int64_t a; \
1095+ pop (stack, a); \
1096+ push (stack, op); \
1097+ return 0 ; \
1098+ }), \
1099+ Operator (#aten_op " (float a) -> " #float_result, [](Stack& stack) { \
1100+ double a; \
1101+ pop (stack, a); \
1102+ push (stack, op); \
1103+ return 0 ; \
1104+ })
10981105
10991106#define DEFINE_BOOL_OP (aten_op, op ) \
11001107 Operator (#aten_op " (bool a, bool b) -> bool" , [](Stack& stack) { \
@@ -2124,6 +2131,7 @@ RegisterOperators reg2({
21242131 DEFINE_UNARY_OP (aten::floor, std::floor (a), float , float ),
21252132 DEFINE_UNARY_OP (aten::ceil, std::ceil (a), float , float ),
21262133 DEFINE_UNARY_OP (aten::log, std::log (a), float , float ),
2134+ DEFINE_BINARY_FLOAT_OP (aten::log, std::log (a) / std::log (b)),
21272135 DEFINE_UNARY_OP (aten::log1p, std::log1p (a), float , float ),
21282136 DEFINE_UNARY_OP (aten::log10, std::log10 (a), float , float ),
21292137 DEFINE_UNARY_OP (aten::exp, std::exp (a), float , float ),
0 commit comments