TensorRT icon indicating copy to clipboard operation
TensorRT copied to clipboard

Empty tensor handling

Open apbose opened this issue 2 months ago • 0 comments

This PR addresses the case of empty tensor in torchTRT based on https://docs.nvidia.com/deeplearning/tensorrt/latest/inference-library/advanced.html#empty-tensors, and also focuses on concat operation edge case involving empty tensor

TODO: Might have to separate the case of concat from this PR, in the case when torch.Tensor([]) and a rank greater tensor are concatenated, which is a valid case in pytorch but not TRT.

This addressed #3865. Corresponding HF transformers issue raised - https://github.com/huggingface/transformers/issues/42027 where empty tensor should not come in the first place

apbose avatar Nov 06 '25 21:11 apbose