-
Notifications
You must be signed in to change notification settings - Fork 364
fix: fix the renaming error in squeeze converter #1187
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
Conversation
Signed-off-by: Bo Wang <[email protected]>
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.
Code conforms to C++ style guidelines
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.
Code conforms to C++ style guidelines
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.
Code conforms to C++ style guidelines
@@ -26,7 +26,8 @@ auto squeeze_registrations TORCHTRT_UNUSED = RegisterNodeConversionPatterns().pa | |||
} | |||
|
|||
if (selfDim[dim] != 1) { | |||
auto out = ctx->AssociateValueAndTensor(n->outputs()[0], self); | |||
auto id_layer = ctx->net->addIdentity(*self); |
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.
You could use already existing utility for this
nvinfer1::ITensor* applyIdentityOp(ConversionCtx* ctx, nvinfer1::ITensor* tensor, const std::string& tensor_name) { |
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.
thanks @peri044. BTW, do we still need this test case
TEST(Converters, ATenSqueezeDontNeedSqueezeConvertsCorrectly) { |
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.
Sounds good. This test doesn't seem useful.
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.
@peri044 it seems that we should have an explicit name for output tensor if we want to use this util:
nvinfer1::ITensor* applyIdentityOp(ConversionCtx* ctx, nvinfer1::ITensor* tensor, const std::string& tensor_name) { |
I checked around but have no idea what name would be appropriate, any idea?
@narendasan @bowang007 is it possible to get this into v1.2? Would be good to close out this issue in this release. |
Signed-off-by: Bo Wang <[email protected]>
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.
Code conforms to C++ style guidelines
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.
This seems fine, are there any other binding name changes that need to be merged?
I don't think so. |
There are merge conflicts and these changes are already merged via another PR #1167 |
Signed-off-by: Bo Wang [email protected]
Description
Some converters may have the risks of renaming ITensors, which might cause errors.
Fixes: #930 , #982
More PRs related to this PR:
#1004 , #1167 ,
Type of change
Checklist: