Skip to content

↔ [Converter] Add support for aten::mul(Bool Tensor, Float Tensor) in TRTorch #341

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

Closed
developer0hye opened this issue Feb 17, 2021 · 2 comments
Labels
component: converters Issues re: Specific op converters feature request New feature or request No Activity

Comments

@developer0hye
Copy link
Contributor

developer0hye commented Feb 17, 2021

TRTorch cannot compile the below function.

@torch.jit.export
def _nms(self, heatmap):
    heatmap_max = nn.functional.max_pool2d(heatmap, self.kernel_size, 1,
                                           self.kernel_size // 2)
    keep = (heatmap_max == heatmap).float()
    return keep * heatmap

When I compiled model including this function with TRTorch, TRTorch recognize keep as Bool Tensor.

The printed error is same with:

[TRTorch Conversion Context] - %heatmap.1 : Tensor = aten::mul(%471, %469) # C:\Users\yhkwon\Documents\project\0215\project\centernet.py:219:15: operation PROD has incompatible input types Bool and Float

It seems that TRTorch cannot recognize type casting function .float().

  • Function Schema:

aten::mul(Tensor, Tensor)

  • Original PyTorch API:

  • Relevant TensorRT Documentation:

Alternatives

Additional context

@developer0hye developer0hye added component: converters Issues re: Specific op converters feature request New feature or request labels Feb 17, 2021
@developer0hye
Copy link
Contributor Author

developer0hye commented Feb 18, 2021

I think that #327 is solution of this case.

@github-actions
Copy link

This issue has not seen activity for 90 days, Remove stale label or comment or this will be closed in 10 days

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: converters Issues re: Specific op converters feature request New feature or request No Activity
Projects
None yet
Development

No branches or pull requests

1 participant