torch2trt icon indicating copy to clipboard operation
torch2trt copied to clipboard

[Feature Request] Add one dimensional tensor support for `add_trt_constant`

Open chaoz-dev opened this issue 3 years ago • 2 comments

Currently, add_trt_constant assumes dim > 1 for input tensors (where the 1st dimension is probably assumed to be the batch dimension).

However, there are situations where we may use one dimensional tensors as input to add_trt_constant, especially now that explicit batch dimensions are supported.

We should add support for the one dimensional use case, as the current implementation with tensor[0] will return the first element of the tensor, which is not the desired behavior.

chaoz-dev avatar Jul 21 '22 02:07 chaoz-dev

I'll put up a PR up for this.

chaoz-dev avatar Jul 21 '22 02:07 chaoz-dev

This is needed for #755

chaoz-dev avatar Jul 21 '22 02:07 chaoz-dev