@@ -42,7 +42,8 @@ Value emitPostProcessingFor(ConversionPatternRewriter &rewriter, Location loc,
42
42
43
43
template <typename Op>
44
44
static void CheckIfCustomScalarOpIsSupported (Type elementType) {
45
- Type actualElementType = MathBuilder::elementTypeWithVector (elementType);
45
+ Type actualElementType =
46
+ MathBuilder::elementTypeOfScalarOrVector (elementType);
46
47
if (mlir::isa<mlir::IntegerType>(actualElementType)) {
47
48
if constexpr (std::is_same<ScalarIOp<Op>, CustomScalarOp>::value)
48
49
return ;
@@ -914,7 +915,7 @@ Value emitScalarOpFor<ONNXSignOp>(ConversionPatternRewriter &rewriter,
914
915
// ConstantOp 0,
915
916
// %Y)
916
917
Value plusSelect;
917
- if (create.math .isUnsignedIntegerWithVector (elementType)) {
918
+ if (create.math .isScalarOrVectorUnsignedInteger (elementType)) {
918
919
// Unsigned integers are by definition positive.
919
920
plusSelect = one;
920
921
} else {
@@ -1188,7 +1189,7 @@ Value emitScalarOpFor<ONNXModOp>(ConversionPatternRewriter &rewriter,
1188
1189
MultiDialectBuilder<MathBuilder, KrnlBuilder> create (rewriter, loc);
1189
1190
1190
1191
// TODO: here we assume fmod=1, what should if that is not the case?
1191
- if (create.math .isFloatWithVector (elementType)) {
1192
+ if (create.math .isScalarOrVectorFloat (elementType)) {
1192
1193
// fmod is always 1. Behavior is like numpy.fmod.
1193
1194
// The sign of the remainder is the same as the dividend.
1194
1195
Value rem = create.math .rem (dividend, divisor);
@@ -1201,7 +1202,7 @@ Value emitScalarOpFor<ONNXModOp>(ConversionPatternRewriter &rewriter,
1201
1202
return create.math .copySign (rem, dividend);
1202
1203
#endif
1203
1204
}
1204
- if (create.math .isIntegerWithVector (elementType)) {
1205
+ if (create.math .isScalarOrVectorInteger (elementType)) {
1205
1206
// "math.rem" returns "minus" for minus dividend and "plus or zero" for plus
1206
1207
// dividend. We call the math.rem's return value "mathRemainder". However
1207
1208
// onnx.ModOp should return "minus" for minus divisor and "plus or zero" for
0 commit comments