Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate IntImm & FloatImm ObjectRef to not-null #5788

Closed

Conversation

ANSHUMAN87
Copy link
Contributor

Refer #5318

@tqchen, @jroesch, @zhiics, @junrushao1994 : Please help review, Thanks!

@@ -123,7 +123,7 @@ PrimExpr RewriteSimplifier::Impl::VisitExpr_(const AddNode* op) {
// Pattern var to match any expression
PVar<PrimExpr> x, y, z, b1, b2, s1, s2;
// Pattern var match IntImm
PVar<IntImm> c1, c2, c3;
PVarOpt<Optional<IntImm>> c1, c2, c3;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it is right to use optional here, as the intention is to match the variable itself

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I agree. It is only to accommodate absent of default constructor. However the behaviour don't violate with PVar I think.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree too...Is there any better to do this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have 2 possible approach here:

A0: Rename PVarOpt --> PVarExt(Extended) and hide Optional input format.
Look like --> PVarExt<IntImm> c1, c2, c3;

A1: Provide default constructor with default values.
Look like: PVar<IntImm> c1(IntImm(DataType::Int(32), 0)), c2(IntImm(DataType::Int(32), 0)), c3(IntImm(DataType::Int(32), 0));

Please let me know your thoughts on this. Thanks!

Copy link
Member

@tqchen tqchen Jun 14, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think either approaches are good here. Let us leave it as it is for now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants