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.
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.