TensorRT 10.0.1
nvonnxparser::IParserRefitter Class Referenceabstract

An interface designed to refit weights from an ONNX model. More...

#include <NvOnnxParser.h>

Public Member Functions

virtual bool refitFromBytes (void const *serializedOnnxModel, size_t serializedOnnxModelSize, char const *modelPath=nullptr) noexcept=0
 Load a serialized ONNX model from memory and perform weight refit. More...
 
virtual bool refitFromFile (char const *onnxModelFile) noexcept=0
 Load and parse a ONNX model from disk and perform weight refit. More...
 
virtual int32_t getNbErrors () const noexcept=0
 Get the number of errors that occurred during prior calls to refitFromBytes or refitFromFile. More...
 
virtual IParserError const * getError (int32_t index) const noexcept=0
 Get an error that occurred during prior calls to refitFromBytes or refitFromFile. More...
 
virtual void clearErrors ()=0
 Clear errors from prior calls to refitFromBytes or refitFromFile. More...
 
virtual ~IParserRefitter () noexcept=default
 

Detailed Description

An interface designed to refit weights from an ONNX model.

Constructor & Destructor Documentation

◆ ~IParserRefitter()

virtual nvonnxparser::IParserRefitter::~IParserRefitter ( )
virtualdefaultnoexcept

Member Function Documentation

◆ clearErrors()

virtual void nvonnxparser::IParserRefitter::clearErrors ( )
pure virtual

Clear errors from prior calls to refitFromBytes or refitFromFile.

See also
getNbErrors() getError() IParserError

◆ getError()

virtual IParserError const * nvonnxparser::IParserRefitter::getError ( int32_t  index) const
pure virtualnoexcept

Get an error that occurred during prior calls to refitFromBytes or refitFromFile.

See also
getNbErrors() IParserError

◆ getNbErrors()

virtual int32_t nvonnxparser::IParserRefitter::getNbErrors ( ) const
pure virtualnoexcept

Get the number of errors that occurred during prior calls to refitFromBytes or refitFromFile.

See also
getError() IParserError

◆ refitFromBytes()

virtual bool nvonnxparser::IParserRefitter::refitFromBytes ( void const *  serializedOnnxModel,
size_t  serializedOnnxModelSize,
char const *  modelPath = nullptr 
)
pure virtualnoexcept

Load a serialized ONNX model from memory and perform weight refit.

Parameters
serializedOnnxModelPointer to the serialized ONNX model
serializedOnnxModelSizeSize of the serialized ONNX model in bytes
modelPathAbsolute path to the model file for loading external weights if required
Returns
true if all the weights in the engine were refit successfully.

The serialized ONNX model must be identical to the one used to generate the engine that will be refit.

◆ refitFromFile()

virtual bool nvonnxparser::IParserRefitter::refitFromFile ( char const *  onnxModelFile)
pure virtualnoexcept

Load and parse a ONNX model from disk and perform weight refit.

Parameters
onnxModelFilePath to the ONNX model to load from disk.
Returns
true if the model was loaded successfully, and if all the weights in the engine were refit successfully.

The provided ONNX model must be identical to the one used to generate the engine that will be refit.


The documentation for this class was generated from the following file:

  Copyright © 2024 NVIDIA Corporation
  Privacy Policy | Manage My Privacy | Do Not Sell or Share My Data | Terms of Service | Accessibility | Corporate Policies | Product Security | Contact