| 159 | } |
| 160 | |
| 161 | void 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 | |
| 180 | void CaffeWeightFactory::convert(Weights& weights) |
| 181 | { |
no outgoing calls
no test coverage detected