-
Notifications
You must be signed in to change notification settings - Fork 365
[Converter] Add support for aten::Int in TRTorch #513
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
This op is a known limitation of TRTorch. Since there are two distinct phases for TRTorch programs, compilation and execution that have different sets of available information, My suggestion is to try using the partial compilation feature to force |
My temporary solution is to use
|
@narendasan : Can we actually work around this issue by internally pretending the result of that Int() operation is a Tensor?
So, if we rewrite "%235 : int = aten::Int(%234)" --> "%235 := %234", wouldn't that work? |
I could see if there is a pair of |
I'm having trouble with this in a model which does some math on the shape of the tensor - I've had this model working in torch2trt before, because it just treats it as a constant (and that's fine), where as the torch.jit tries to capture the math on the shape somehow. Any way around this? Ideally this isn't in the compiled model - is there a way to make the torch jit treat it like a constant? |
Have you tried the workaround above? Basically explicitly cast the int in python |
Stumbled upon this issue as well, tried explicitly casting the int to all floor operations in the forward method and it did work |
This issue has not seen activity for 90 days, Remove stale label or comment or this will be closed in 10 days |
This issue has not seen activity for 90 days, Remove stale label or comment or this will be closed in 10 days |
aten::Int.Tensor(a)
aten::Int.Tensor(a) -> (int)
Is your feature request related to a problem?

The conversion of a model to the TRTorch variant had troubles supporting a specific operator (aten::Tensor(a) -> (int))
Alternatives
Additional Context
The text was updated successfully, but these errors were encountered: