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

trt8510 not support topk with input is int or int64 #57

Open
lix19937 opened this issue Nov 7, 2024 · 1 comment
Open

trt8510 not support topk with input is int or int64 #57

lix19937 opened this issue Nov 7, 2024 · 1 comment

Comments

@lix19937
Copy link
Owner

lix19937 commented Nov 7, 2024

follow is passed.

import torch

class MyModel(torch.nn.Module):
    def __init__(self):
        super(MyModel, self).__init__()
    def forward(self, x):
        x, _ = x.topk(k=10, dim=0, largest=False)
        return x

model = MyModel()
x = torch.ones(120, 1, 128, 128, dtype=torch.float32)

with torch.no_grad():
    torch.onnx.export(
        model,
        (x),
        'topk.onnx',
        opset_version=17,
        )
    
@lix19937
Copy link
Owner Author

lix19937 commented Nov 7, 2024

follow is wrong.

import torch

class MyModel(torch.nn.Module):
    def __init__(self):
        super(MyModel, self).__init__()
    def forward(self, x):
        x, _ = x.topk(k=10, dim=0, largest=False)
        return x

model = MyModel()
x = torch.ones(120, 1, 128, 128, dtype=torch.int32)

with torch.no_grad():
    torch.onnx.export(
        model,
        (x),
        'topk.onnx',
        opset_version=17,
        )
    

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

1 participant