-
Notifications
You must be signed in to change notification settings - Fork 301
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
Forward input dims in Reshape ShapeHelper #2828
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Tung D. Le <tung@jp.ibm.com>
@AlexandreEichenberger if you know how to modify |
Signed-off-by: Tung D. Le <tung@jp.ibm.com>
outputDims[i] = outputDims[i].selectOrSelf( | ||
outputDims[i] == -1, numOfElements.floorDiv(numOfElementsFromShape)); | ||
dimShape == -1, numOfElements.floorDiv(numOfElementsFromShape)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed this to make the compare expression literal.
It looks like I found the way to change |
@tungld is there still a case to look into? |
I changed |
@AlexandreEichenberger It's ready for review. |
In this reshape op in a quantized bert model, the first two dimensions of the output are the same as the ones in the input, so we would like to forward IndexExprs of these dimensions from the input to the output so that DimAnalysis works. But it failed because of using
IndexExpr.selectOrSelf
.I think the better solution would be updating
selectOrSelf
, but I don't really understand it and just make a change in the Reshape's ShapeHelper as a workaround.