Skip to content

feat: Add converter files for torch::max #934

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
wants to merge 4 commits into from

Conversation

p517332051
Copy link
Contributor

@p517332051 p517332051 commented Mar 18, 2022

Description

This PR is new feature,that add support for torch::max operator, the mainly implemented by using the topk of tensorrt.

Type of change

  • New feature (non-breaking change which adds functionality)

Checklist:

  • My code follows the style guidelines of this project (You can use the linters)
  • I have performed a self-review of my own code
  • New and existing unit tests pass locally with my changes

Copy link
Collaborator

@peri044 peri044 left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution. Please add a test case as well.

}
uint32_t shiftDim = 1 << dim;

auto TopKOperation = largest ? (nvinfer1::TopKOperation::kMAX) : (nvinfer1::TopKOperation::kMIN);
Copy link
Collaborator

Choose a reason for hiding this comment

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

you can remove auto largest = true and change this line to auto TopKOperation = largest ? (nvinfer1::TopKOperation::kMAX) since we are only using max always here

Copy link
Contributor Author

@p517332051 p517332051 left a comment

Choose a reason for hiding this comment

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

I have removed "largest = true " and changed “ auto TopKOperation = largest ? (nvinfer1::TopKOperation::kMAX) ” to to TopKOperation = nvinfer1::TopKOperation::kMAX".

@p517332051 p517332051 closed this Mar 21, 2022
@p517332051 p517332051 reopened this Mar 21, 2022
@p517332051 p517332051 force-pushed the Netease-Torch-TensorRT branch from 9ee9f86 to a1880d4 Compare March 21, 2022 11:31
@peri044
Copy link
Collaborator

peri044 commented Mar 22, 2022

Please sign your commits so that DCO passes

@p517332051 p517332051 force-pushed the Netease-Torch-TensorRT branch from a1880d4 to 62b6d05 Compare March 23, 2022 02:00
@p517332051 p517332051 requested a review from peri044 March 23, 2022 02:30
@p517332051
Copy link
Contributor Author

Please sign your commits so that DCO passes

get

@p517332051 p517332051 force-pushed the Netease-Torch-TensorRT branch from 81db792 to 0b5673b Compare March 23, 2022 03:50
@narendasan
Copy link
Collaborator

We still need a test case for this operator to merge

@peri044 peri044 mentioned this pull request Apr 18, 2022
6 tasks
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

Successfully merging this pull request may close these issues.

3 participants