MCPcopy Create free account
hub / github.com/NVIDIA/TensorRT / override_shape

Function override_shape

tools/tensorflow-quantization/examples/infer_engine.py:107–113  ·  view source on GitHub ↗

Overrides batch dimension if dynamic.

(shape: tuple)

Source from the content-addressed store, hash-verified

105 """
106
107 def override_shape(shape: tuple) -> tuple:
108 """Overrides batch dimension if dynamic."""
109 if TRT_DYNAMIC_DIM in shape:
110 shape = tuple(
111 [batch_size if dim == TRT_DYNAMIC_DIM else dim for dim in shape]
112 )
113 return shape
114
115 # Open engine as runtime
116 with open(engine_path, "rb") as f, trt.Runtime(

Callers 1

inferFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected