Skip to content
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

AttributeError when using torch.nn.functional.pad #936

Open
clementabary opened this issue Jun 19, 2024 · 3 comments
Open

AttributeError when using torch.nn.functional.pad #936

clementabary opened this issue Jun 19, 2024 · 3 comments

Comments

@clementabary
Copy link

Hi all, when I run conversion of the following operation:

x_padded = torch.nn.functional.pad(x, (0, 0, pad_left, pad_right))

I get the error below:

AttributeError: 'tensorrt_bindings.tensorrt.INetworkDefinition' object has no attribute 'add_padding'. Did you mean: 'add_padding_nd'?

Do you know any way to circumvent this issue? Thanks in advance 🙏

@lryain
Copy link

lryain commented Oct 2, 2024

Same error here!

@itachi1232gg
Copy link

you are probably using tensorrt10, INetworkDefinition.add_padding() is changed to INetworkDefinition.add_padding_nd()

@korkland
Copy link

korkland commented Jan 2, 2025

you are probably using tensorrt10, INetworkDefinition.add_padding() is changed to INetworkDefinition.add_padding_nd()

Im using torch2trt 0.5.0 and trt 10.0.1, and have the same issue, after reimplementing the pad convert using add_padding_nd(), not it fail on shaping issue, looks like padding_nd outputs dynamic shaping. Any idea how to resolve this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants