diff --git a/src/relay/op/tensor/transform.cc b/src/relay/op/tensor/transform.cc index 899f5c3a67851..b3cb0557ebb6e 100644 --- a/src/relay/op/tensor/transform.cc +++ b/src/relay/op/tensor/transform.cc @@ -892,7 +892,7 @@ bool ArangeRel(const Array& types, IndexExpr num_elem = tvm::cast(tvm::Int(32), tvm::ceil( tvm::cast(tvm::Float(32), param->stop - param->start) / param->step)); if (const tvm::ir::IntImm* val = num_elem.as()) { - CHECK_GE(val->value, 0) << "Invalid arange inputs"; + CHECK_GT(val->value, 0) << "Invalid arange inputs"; } reporter->Assign(types[0], TensorTypeNode::make({num_elem}, param->dtype)); return true; diff --git a/tests/python/relay/test_op_level3.py b/tests/python/relay/test_op_level3.py index 8329ee24ad8b2..e762c7d3a1a08 100644 --- a/tests/python/relay/test_op_level3.py +++ b/tests/python/relay/test_op_level3.py @@ -489,7 +489,6 @@ def verify_arange(start, stop, step): verify_arange(1, 20, 3) verify_arange(20, 1, -1) verify_arange(20, 1, -1.5) - verify_arange(5, 5, 1) if __name__ == "__main__":