Skip to content

Commit 874de94

Browse files
authored
Fixing datatype error for gpt-2 (#18328)
1 parent 7ec2d35 commit 874de94

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/relax/op/op_common.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ inline DataType InferBinaryArithOpOutDtype(const Call& call, const BlockBuilder&
319319

320320
if (lhs_dtype.is_void() || rhs_dtype.is_void()) {
321321
return DataType::Void();
322-
} else if (lhs_dtype != rhs_dtype) {
322+
} else if (lhs_dtype != rhs_dtype && !lhs_dtype.is_bool() && !rhs_dtype.is_bool()) {
323323
ctx->ReportFatal(Diagnostic::Error(call)
324324
<< "TypeError: "
325325
<< "Binary operators must have the same datatype for both operands. "

0 commit comments

Comments
 (0)