TensorRT
TensorRT copied to clipboard
Empty tensor handling
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