此接口旨在重新拟合 ONNX 模型的权重。更多...
#include <NvOnnxParser.h>
|
virtual bool | refitFromBytes (void const *serializedOnnxModel, size_t serializedOnnxModelSize, char const *modelPath=nullptr) noexcept=0 |
| 从内存加载序列化的 ONNX 模型并执行权重重新拟合。更多...
|
|
virtual bool | refitFromFile (char const *onnxModelFile) noexcept=0 |
| 从磁盘加载并解析 ONNX 模型,并执行权重重新拟合。更多...
|
|
virtual int32_t | getNbErrors () const noexcept=0 |
| 获取先前调用 refitFromBytes 或 refitFromFile 期间发生的错误数量。更多...
|
|
virtual IParserError const * | getError (int32_t index) const noexcept=0 |
| 获取先前调用 refitFromBytes 或 refitFromFile 期间发生的错误。更多...
|
|
virtual void | clearErrors ()=0 |
| 清除先前调用 refitFromBytes 或 refitFromFile 产生的错误。更多...
|
|
virtual | ~IParserRefitter () noexcept=default |
|
此接口旨在重新拟合 ONNX 模型的权重。
- 警告
- 请勿从此类继承,这样做会破坏 API 和 ABI 的向前兼容性。
◆ ~IParserRefitter()
virtual nvonnxparser::IParserRefitter::~IParserRefitter |
( |
| ) |
|
|
virtualdefaultnoexcept |
◆ clearErrors()
virtual void nvonnxparser::IParserRefitter::clearErrors |
( |
| ) |
|
|
pure virtual |
◆ getError()
virtual IParserError const * nvonnxparser::IParserRefitter::getError |
( |
int32_t |
index | ) |
const |
|
pure virtualnoexcept |
◆ getNbErrors()
virtual int32_t nvonnxparser::IParserRefitter::getNbErrors |
( |
| ) |
const |
|
pure virtualnoexcept |
◆ refitFromBytes()
virtual bool nvonnxparser::IParserRefitter::refitFromBytes |
( |
void const * |
serializedOnnxModel, |
|
|
size_t |
serializedOnnxModelSize, |
|
|
char const * |
modelPath = nullptr |
|
) |
| |
|
pure virtualnoexcept |
从内存加载序列化的 ONNX 模型并执行权重重新拟合。
- 参数
-
serializedOnnxModel | 指向序列化 ONNX 模型的指针 |
serializedOnnxModelSize | 序列化 ONNX 模型的大小(字节) |
modelPath | 模型文件的绝对路径,用于在需要时加载外部权重 |
- 返回值
- 如果引擎中的所有权重都成功重新拟合,则返回 true。
序列化的 ONNX 模型必须与用于生成要重新拟合的引擎的模型相同。
◆ refitFromFile()
virtual bool nvonnxparser::IParserRefitter::refitFromFile |
( |
char const * |
onnxModelFile | ) |
|
|
pure virtualnoexcept |
从磁盘加载并解析 ONNX 模型,并执行权重重新拟合。
- 参数
-
onnxModelFile | 要从磁盘加载的 ONNX 模型路径。 |
- 返回值
- 如果模型加载成功,并且引擎中的所有权重都成功重新拟合,则返回 true。
提供的 ONNX 模型必须与用于生成要重新拟合的引擎的模型相同。
此类文档从以下文件生成