State the limitation when chunk / unbind meet a dynamic dim - #2811
Open
LeSingh1 wants to merge 1 commit into
Open
State the limitation when chunk / unbind meet a dynamic dim#2811LeSingh1 wants to merge 1 commit into
LeSingh1 wants to merge 1 commit into
Conversation
Both ops derive their number of outputs from the size of the dim they act on, so that dim has to be known at conversion time. Neither said so. constantchunk did float(x.shape[dim]) and unbind did [1] * x.shape[dim], which on a symbolic dim raise "TypeError: Cannot convert expression to float" and "TypeError: can't multiply sequence by non-int of type 'Symbol'" from inside the converter, with nothing naming the op or the limitation. Raise a ValueError that says which dim is the problem and what to do instead, as _adaptive_pool2d already does for the same situation. No model that converts today is affected: these paths only ever raised. Also adds the first chunk tests; there were none.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
chunkandunbindboth derive their number of outputs from the size of the dim they act on, so that dim has to be known at conversion time. Neither says so.Neither message names the op or the limitation, and both come from inside the converter.
This raises a
ValueErrorsaying which dim is the problem and what to do instead, following what_adaptive_pool2dalready does for the same situation. No model that converts today is affected — these paths only ever raised.Also adds the first
chunktests; there were none.