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

Method getBlob

parsers/caffe/caffeWeightFactory/caffeWeightFactory.cpp:106–130  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

104}
105
106const trtcaffe::BlobProto* CaffeWeightFactory::getBlob(const std::string& layerName, int index)
107{
108 if (mMsg.layer_size() > 0)
109 {
110 for (int i = 0, n = mMsg.layer_size(); i < n; i++)
111 {
112 if (mMsg.layer(i).name() == layerName && index < mMsg.layer(i).blobs_size())
113 {
114 return &mMsg.layer(i).blobs(index);
115 }
116 }
117 }
118 else
119 {
120 for (int i = 0, n = mMsg.layers_size(); i < n; i++)
121 {
122 if (mMsg.layers(i).name() == layerName && index < mMsg.layers(i).blobs_size())
123 {
124 return &mMsg.layers(i).blobs(index);
125 }
126 }
127 }
128
129 return nullptr;
130}
131
132std::vector<Weights> CaffeWeightFactory::getAllWeights(const std::string& layerName)
133{

Callers 2

getEngineBuildEnvFunction · 0.80
timeDeserializeFunction · 0.80

Calls 2

nameMethod · 0.80
layerMethod · 0.80

Tested by

no test coverage detected