Skip to content

Commit 1c3c779

Browse files
committed
docs: update docs with binding name restrictions
Signed-off-by: Naren Dasan <[email protected]> Signed-off-by: Naren Dasan <[email protected]>
1 parent 819c911 commit 1c3c779

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

cpp/include/torch_tensorrt/torch_tensorrt.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -739,7 +739,12 @@ TORCHTRT_API std::string convert_method_to_trt_engine(
739739
* module. Registers execution of the engine as the forward method of the module
740740
* Forward is defined as: forward(Tensor[]) -> Tensor[]
741741
*
742-
* @return: A new module trageting a TensorRT engine
742+
* TensorRT bindings must have names with the following format:
743+
* - [symbol].[index in input / output array]
744+
* ex.
745+
* - [x.0, x.1, x.2] -> [y.0]
746+
*
747+
* @return: A new module targeting a TensorRT engine
743748
*/
744749
TORCHTRT_API torch::jit::Module embed_engine_in_new_module(const std::string& engine, Device device);
745750
} // namespace torchscript

py/torch_tensorrt/ts/_compiler.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,11 @@ def embed_engine_in_new_module(serialized_engine: bytes, device=Device._current_
207207
208208
forward(Tensor[]) -> Tensor[]
209209
210+
TensorRT bindings must have names with the following format:
211+
- [symbol].[index in input / output array]
212+
ex.
213+
- [x.0, x.1, x.2] -> [y.0]
214+
210215
Module can be save with engine embedded with torch.jit.save and moved / loaded according to torch_tensorrt portability rules
211216
212217
Arguments:

0 commit comments

Comments
 (0)