Skip to content

Conversation

gs-olive
Copy link
Contributor

@gs-olive gs-olive commented Dec 7, 2022

Description

  • Behavior of Torch-TRT differs from that of Torch in the case where the input tensors to aten::where have different rank
  • Torch automatically broadcasts tensors to the highest-rank variant whereas the TRT Select layer requires tensors of the same rank and throws an error
  • Add dimension checking and unsqueeze operator to ensure broadcasting is enabled
  • Add test case to catch error

Resolves Part 1 of solution to Issue #1455

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • [ x ] My code follows the style guidelines of this project (You can use the linters)
  • [ x ] I have performed a self-review of my own code
  • [ x ] I have commented my code, particularly in hard-to-understand areas and hacks
  • [ x ] I have made corresponding changes to the documentation
  • [ x ] I have added tests to verify my fix or my feature
  • [ x ] New and existing unit tests pass locally with my changes
  • [ x ] I have added the relevant labels to my PR in so that relevant reviewers are notified

@github-actions github-actions bot added component: conversion Issues re: Conversion stage component: converters Issues re: Specific op converters component: core Issues re: The core compiler component: tests Issues re: Tests labels Dec 7, 2022
@gs-olive gs-olive self-assigned this Dec 7, 2022
- Behavior of Torch-TRT differing from that of Torch in the case where
the input tensors to `aten::where` have different rank
- Torch automatically broadcasts tensors to the highest-rank variant
whereas the TRT Select layer requires tensors of the same rank and
throws an error
- Add dimension checking and unsqueeze operator to ensure broadcasting
is enabled
- Add test case to catch error
Copy link
Collaborator

@narendasan narendasan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@narendasan narendasan merged commit d923805 into pytorch:master Dec 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla signed component: conversion Issues re: Conversion stage component: converters Issues re: Specific op converters component: core Issues re: The core compiler component: tests Issues re: Tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants