torch2trt
torch2trt copied to clipboard
[Feature Request] Add one dimensional tensor support for `add_trt_constant`
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.
I'll put up a PR up for this.
This is needed for #755