Skip to content

Unclear comparisons in conditional operator implementation #2179

Closed
@narendasan

Description

@narendasan

if condition_shape != condition_dim: # TODO: What is this checking?

if type(input) != TRTTensor:
if x_shape != input_dim: # TODO: What is this checking?

https://github.com/pytorch/TensorRT/blob/918e9832207d462c2a3aa42f9e7d3ab7aa7415aa/py/torch_tensorrt/dynamo/conversion/impl/condition/ops.py

The above lines are being flagged by mypy as the following:

py/torch_tensorrt/dynamo/conversion/impl/condition/ops.py:68: error: Non-overlapping equality check (left operand type: "list[Any]", right operand type: "int")  [comparison-overlap]
py/torch_tensorrt/dynamo/conversion/impl/condition/ops.py:76: error: Non-overlapping equality check (left operand type: "list[Any]", right operand type: "int")  [comparison-overlap]
py/torch_tensorrt/dynamo/conversion/impl/condition/ops.py:98: error: Non-overlapping equality check (left operand type: "list[Any]", right operand type: "int")  [comparison-overlap]

I cant really figure out what is being checked here but it is likely a bug.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions