TensorRT 8.5.3
NvCaffeParser.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: Copyright (c) 1993-2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3 * SPDX-License-Identifier: LicenseRef-NvidiaProprietary
4 *
5 * NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
6 * property and proprietary rights in and to this material, related
7 * documentation and any modifications thereto. Any use, reproduction,
8 * disclosure or distribution of this material and related documentation
9 * without an express license agreement from NVIDIA CORPORATION or
10 * its affiliates is strictly prohibited.
11 */
12
13#ifndef NV_CAFFE_PARSER_H
14#define NV_CAFFE_PARSER_H
15
16#include "NvInfer.h"
17
23
29namespace nvcaffeparser1
30{
31
44{
45public:
52 virtual nvinfer1::ITensor* find(char const* name) const noexcept = 0;
53
54protected:
55 virtual ~IBlobNameToTensor() {}
56};
57
68{
69public:
70 virtual void const* getData() noexcept = 0;
71 virtual nvinfer1::Dims4 getDimensions() noexcept = 0;
72 virtual nvinfer1::DataType getDataType() noexcept = 0;
78 TRT_DEPRECATED virtual void destroy() noexcept = 0;
79 virtual ~IBinaryProtoBlob() noexcept = default;
80};
81
88{
89public:
95 virtual bool isPluginV2(char const* layerName) noexcept = 0;
96
105 virtual nvinfer1::IPluginV2* createPlugin(char const* layerName, nvinfer1::Weights const* weights,
106 int32_t nbWeights, char const* libNamespace = "") noexcept = 0;
107
108 virtual ~IPluginFactoryV2() noexcept = default;
109};
120{
121public:
135 virtual IBlobNameToTensor const* parse(char const* deploy, char const* model, nvinfer1::INetworkDefinition& network,
136 nvinfer1::DataType weightType) noexcept = 0;
137
153 virtual IBlobNameToTensor const* parseBuffers(uint8_t const* deployBuffer, std::size_t deployLength,
154 uint8_t const* modelBuffer, std::size_t modelLength, nvinfer1::INetworkDefinition& network,
155 nvinfer1::DataType weightType) noexcept = 0;
156
169 virtual IBinaryProtoBlob* parseBinaryProto(char const* fileName) noexcept = 0;
170
178 virtual void setProtobufBufferSize(size_t size) noexcept = 0;
179
187 TRT_DEPRECATED virtual void destroy() noexcept = 0;
188
194 virtual void setPluginFactoryV2(IPluginFactoryV2* factory) noexcept = 0;
195
199 virtual void setPluginNamespace(char const* libNamespace) noexcept = 0;
200
201 virtual ~ICaffeParser() noexcept = default;
202
203public:
218 virtual void setErrorRecorder(nvinfer1::IErrorRecorder* recorder) noexcept = 0;
219
230 virtual nvinfer1::IErrorRecorder* getErrorRecorder() const noexcept = 0;
231};
232
244
251} // namespace nvcaffeparser1
252
257extern "C" TENSORRTAPI void* createNvCaffeParser_INTERNAL() noexcept;
258#endif
#define TENSORRTAPI
Definition: NvInferRuntimeCommon.h:54
#define TRT_DEPRECATED
Definition: NvInferRuntimeCommon.h:40
Object used to store and query data extracted from a binaryproto file using the ICaffeParser.
Definition: NvCaffeParser.h:68
virtual TRT_DEPRECATED void destroy() noexcept=0
virtual void const * getData() noexcept=0
virtual nvinfer1::DataType getDataType() noexcept=0
virtual nvinfer1::Dims4 getDimensions() noexcept=0
Object used to store and query Tensors after they have been extracted from a Caffe model using the IC...
Definition: NvCaffeParser.h:44
virtual nvinfer1::ITensor * find(char const *name) const noexcept=0
Given a blob name, returns a pointer to a ITensor object.
virtual ~IBlobNameToTensor()
Definition: NvCaffeParser.h:55
Class used for parsing Caffe models.
Definition: NvCaffeParser.h:120
virtual IBlobNameToTensor const * parseBuffers(uint8_t const *deployBuffer, std::size_t deployLength, uint8_t const *modelBuffer, std::size_t modelLength, nvinfer1::INetworkDefinition &network, nvinfer1::DataType weightType) noexcept=0
Parse a deploy prototxt and a binaryproto Caffe model from memory buffers to extract network definiti...
virtual void setProtobufBufferSize(size_t size) noexcept=0
Set buffer size for the parsing and storage of the learned model.
virtual IBinaryProtoBlob * parseBinaryProto(char const *fileName) noexcept=0
Parse and extract data stored in binaryproto file.
virtual IBlobNameToTensor const * parse(char const *deploy, char const *model, nvinfer1::INetworkDefinition &network, nvinfer1::DataType weightType) noexcept=0
Parse a prototxt file and a binaryproto Caffe model to extract network definition and weights associa...
virtual TRT_DEPRECATED void destroy() noexcept=0
Destroy this ICaffeParser object.
Plugin factory used to configure plugins.
Definition: NvCaffeParser.h:88
virtual nvinfer1::IPluginV2 * createPlugin(char const *layerName, nvinfer1::Weights const *weights, int32_t nbWeights, char const *libNamespace="") noexcept=0
Creates a plugin.
virtual bool isPluginV2(char const *layerName) noexcept=0
A user implemented function that determines if a layer configuration is provided by an IPluginV2.
A network definition for input to the builder.
Definition: NvInfer.h:6582
Plugin class for user-implemented layers.
Definition: NvInferRuntimeCommon.h:394
A tensor in a network definition.
Definition: NvInfer.h:172
An array of weights used as a layer parameter.
Definition: NvInferRuntime.h:126
The TensorRT Caffe parser API namespace.
void shutdownProtobufLibrary() noexcept
Shuts down protocol buffers library.
ICaffeParser * createCaffeParser() noexcept
Creates a ICaffeParser object.
The TensorRT API version 1 namespace.
DataType
The type of weights and tensors.
Definition: NvInferRuntimeCommon.h:117

  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