Closed Qi-Zha0 closed 1 month ago
Hello @Qi-Zha0 ,
You should pass torch tensor inputs to the save API. These inputs should be in the range (min_shape, opt_shape, max_shape). eg: torch_tensorrt.save(trt_gm, "trt_gm.ep", inputs=[torch.randn(4, 3, 224, 224).cuda()])
. We shall update the documentation to make this more clear. Thanks !!
@peri044 Thank you for clarifying!
❓ Question
I was following the documentation on compiling a model with dynamic input shape. When saving the compiled graph module (following this), the new
torch_tensorrt.save(module, path, inputs)
API requiresinputs
to be all tensors. How do I pass dynamic shapes totorch_tensorrt.save
? Error: https://github.com/pytorch/TensorRT/blob/77278fe395d6ffdd456fd7a8a94852cd27ee63a9/py/torch_tensorrt/_compile.py#L420What you have already tried
Environment
conda
,pip
,libtorch
, source):Additional context