-
Notifications
You must be signed in to change notification settings - Fork 363
❓ [Question] How to convert at::tensor into nvinfer1::ITensor? #146
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
Comments
You can add a IConstant layer to freeze the auto t = args[0].unwrapToTensor();
auto t_weights = Weights(ctx, t);
auto const_layer = ctx->net->addConstant(t_weights.shape, t_weights.data);
auto const_tensor = const_layer->getOutput(0); Const tensor is then a |
This however seems like the issue is that there is some static value with should be frozen beforehand. Seems similar to #145 |
I added code to "aten::sub" and "aten::div" in trtorch/core/conversion/converters/impl/element_wise.cpp
Problem solved. Compile pt model passed. Hope this helps, thanks. |
❓ Question
how to convert at::tensor into nvinfer1::ITensor?
What you have already tried
I tried to run resnet101 using trtorch, however, there was an error when compiling the graph.
As a result of my analysis
TRTorch/core/conversion/converters/impl/element_wise.cpp
self is the ITensor type
other is the IValue type
Thus, this program exits with an error in determining the type.
auto other = args[1].ITensor();
I know IValue can be unpacked into at::tensor, however add_elementwise requires nvinfer1::ITensor
Environment
The text was updated successfully, but these errors were encountered: