fix: Handle nonetype pad value for Constant pad by peri044 · Pull Request #1712 · pytorch/TensorRT (original) (raw)
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
[ Show hidden characters]({{ revealButtonHref }})
Description
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.
Fixes # (issue)
Type of change
Please delete options that are not relevant and/or add your own.
- Bug fix (non-breaking change which fixes an issue)
- New feature (non-breaking change which adds functionality)
- Breaking change (fix or feature that would cause existing functionality to not work as expected)
- This change requires a documentation update
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
- I have commented my code, particularly in hard-to-understand areas and hacks
- I have made corresponding changes to the documentation
- I have added tests to verify my fix or my feature
- New and existing unit tests pass locally with my changes
- I have added the relevant labels to my PR in so that relevant reviewers are notified
Signed-off-by: Dheeraj Peri peri.dheeraj@gmail.com
Signed-off-by: Dheeraj Peri peri.dheeraj@gmail.com
[](/apps/github-actions)
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code conforms to Python style guidelines
[](/apps/github-actions)
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are some changes that do not conform to C++ style guidelines:
diff --git a/home/runner/work/TensorRT/TensorRT/core/lowering/passes/replace_aten_pad.cpp b/tmp/changes.txt index 23e62e1..dd5e721 100644 --- a/home/runner/work/TensorRT/TensorRT/core/lowering/passes/replace_aten_pad.cpp +++ b/tmp/changes.txt @@ -101,7 +101,7 @@ void ReplaceAtenPad(std::shared_ptrtorch::jit::Graph& graph) { torch::jit::Node* new_node; auto pad_value = it->inputs()[3]; auto is_pad_none = torch::jit::toIValue(it->inputs()[3])->isNone();
if(is_pad_none){
if (is_pad_none) { pad_value = graph->insertConstant(0.0); }
ERROR: Some files do not conform to style guidelines
[](/apps/github-actions)
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are some changes that do not conform to C++ style guidelines:
diff --git a/home/runner/work/TensorRT/TensorRT/core/lowering/passes/replace_aten_pad.cpp b/tmp/changes.txt index 23e62e1..dd5e721 100644 --- a/home/runner/work/TensorRT/TensorRT/core/lowering/passes/replace_aten_pad.cpp +++ b/tmp/changes.txt @@ -101,7 +101,7 @@ void ReplaceAtenPad(std::shared_ptrtorch::jit::Graph& graph) { torch::jit::Node* new_node; auto pad_value = it->inputs()[3]; auto is_pad_none = torch::jit::toIValue(it->inputs()[3])->isNone();
if(is_pad_none){
if (is_pad_none) { pad_value = graph->insertConstant(0.0); }
ERROR: Some files do not conform to style guidelines
[](/apps/github-actions)
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code conforms to Python style guidelines
Signed-off-by: Dheeraj Peri peri.dheeraj@gmail.com
[](/apps/github-actions)
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code conforms to C++ style guidelines
[](/apps/github-actions)
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code conforms to Python style guidelines
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM