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

Fix shape inference for Loop@v19 and v21 #164

Closed
wants to merge 4 commits into from
Closed

Conversation

cbourjau
Copy link
Collaborator

Fixes #163

Checklist

  • Added a CHANGELOG.rst entry


for name, typ in zip(carried_names, carried_types):
output_types[name] = typ

Copy link
Member

@adityagoel4512 adityagoel4512 Jul 24, 2024

Choose a reason for hiding this comment

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

Did you not want to check the output type of the body is compatible with the initial value as per #163 (comment)?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Right now this PR just continues with the existing behavior of earlier opsets, which is arguably not good enough. @MatejUrbanQC How did you end up solving your issue? Would we break your solution if we were to impose stricter checks here?

Choose a reason for hiding this comment

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

I'm not using loops in the end, so that's fine.

But I think this only make sense if you can explicitly mark dimensions that you want to change in the loop as None.

Let's say I want to use a function lambda x: concat([x, [0]], axis=0) in the loop.
If my input has shape (None,), then the shape inference passes, because the output is also (None,).
However, if my input has known shape, it will fail.

So it's not just very limiting, it's also inconsistent.

These issues should go away if you can say "This dimensions will be changed, treat it as None". If the number of dimensions will also change, you set the whole shape to None.

@cbourjau
Copy link
Collaborator Author

I'm marking this as "draft" since the current implementation is too limiting / inconsistent.

@cbourjau cbourjau marked this pull request as draft October 24, 2024 08:49
@neNasko1 neNasko1 mentioned this pull request Jan 2, 2025
1 task
@adityagoel4512
Copy link
Member

Will be superseded by #198.

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.

Bugs in loop shape inference
4 participants