Skip to content

🐛 [Bug] slice_op not able to handle start value with type trt.ITensor #4186

@shahe-nv

Description

@shahe-nv

Bug Description

In py/torch_tensorrt/dynamo/conversion/impl/slice/ops.py, function slice_op, Line 112, it only considers the case when start is int, but not the case when start is trt.ITensor.

I tried to add support for start being trt.ITensor, however, I'm not able to run successfully because TRT requires the start being a shape tensor to be able to do shape inference but it seems start is not a shape tensor. Therefore, currently I'm only able to do a workaround by hard coding all the parameters of the slice layer.

To Reproduce

Steps to reproduce the behavior:

Expected behavior

Environment

Build information about Torch-TensorRT can be found by turning on debug messages

  • Torch-TensorRT Version (e.g. 1.0.0):
  • PyTorch Version (e.g. 1.0):
  • CPU Architecture:
  • OS (e.g., Linux):
  • How you installed PyTorch (conda, pip, libtorch, source):
  • Build command you used (if compiling from source):
  • Are you using local sources or building from archives:
  • Python version:
  • CUDA version:
  • GPU models and configuration:
  • Any other relevant information:

Additional context

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions