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

Method save

samples/python/detectron2/create_onnx.py:189–199  ·  view source on GitHub ↗

Save the ONNX model to the given location. :param output_path: Path pointing to the location where to write out the updated ONNX model.

(self, output_path)

Source from the content-addressed store, hash-verified

187 return final_anchors
188
189 def save(self, output_path):
190 """
191 Save the ONNX model to the given location.
192 :param output_path: Path pointing to the location where to write out the updated ONNX model.
193 """
194 self.graph.cleanup().toposort()
195 model = gs.export_onnx(self.graph)
196 output_path = os.path.realpath(output_path)
197 os.makedirs(os.path.dirname(output_path), exist_ok=True)
198 onnx.save(model, output_path)
199 log.info("Saved ONNX model to {}".format(output_path))
200
201 def update_preprocessor(self, batch_size):
202 """

Callers 9

mainFunction · 0.95
mainFunction · 0.45
mainFunction · 0.45
visualize_detectionsFunction · 0.45
_do_graph_surgeryFunction · 0.45
mainFunction · 0.45
mainFunction · 0.45
mainFunction · 0.45
mainFunction · 0.45

Calls 3

toposortMethod · 0.80
cleanupMethod · 0.45
infoMethod · 0.45

Tested by

no test coverage detected