Skip to content

fix: aten.index converter #2487

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

Merged
merged 2 commits into from
Dec 12, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion py/torch_tensorrt/dynamo/conversion/aten_ops_converters.py
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,19 @@ def aten_ops_sigmoid(
)


@dynamo_tensorrt_converter(torch.ops.aten.index.Tensor)
def index_dtype_validator(node: Node) -> bool:
index = node.args[1]
for ind in index:
if ind is not None:
val = ind.meta.get("val")
if val is not None and val.dtype != torch.int32:
return False
return True


@dynamo_tensorrt_converter(
torch.ops.aten.index.Tensor, capability_validator=index_dtype_validator
)
@enforce_tensor_types(
{
0: (TRTTensor,),
Expand Down