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

Method convert

parsers/caffe/caffeWeightFactory/caffeWeightFactory.cpp:161–178  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

159}
160
161void CaffeWeightFactory::convert(Weights& weights, DataType targetType)
162{
163 void* tmpAlloc{nullptr};
164 if (weights.type == DataType::kFLOAT && targetType == DataType::kHALF)
165 {
166 tmpAlloc = convertInternal<float, float16>(const_cast<void**>(&weights.values), weights.count, &mOK);
167 weights.type = targetType;
168 }
169 if (weights.type == DataType::kHALF && targetType == DataType::kFLOAT)
170 {
171 tmpAlloc = convertInternal<float16, float>(const_cast<void**>(&weights.values), weights.count, &mOK);
172 weights.type = targetType;
173 }
174 if (tmpAlloc)
175 {
176 mTmpAllocs.push_back(tmpAlloc);
177 }
178}
179
180void CaffeWeightFactory::convert(Weights& weights)
181{

Callers 6

parseConvolutionFunction · 0.45
parseDeconvolutionFunction · 0.45
parseInnerProductFunction · 0.45
parseBatchNormalizationFunction · 0.45
parsePowerFunction · 0.45
parseScaleFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected