| 442 | } |
| 443 | |
| 444 | const void* RndInt8Calibrator::readCalibrationCache(size_t& length) noexcept |
| 445 | { |
| 446 | mCalibrationCache.clear(); |
| 447 | std::ifstream input(mCacheFile, std::ios::binary); |
| 448 | input >> std::noskipws; |
| 449 | if (input.good()) |
| 450 | { |
| 451 | std::copy( |
| 452 | std::istream_iterator<char>(input), std::istream_iterator<char>(), std::back_inserter(mCalibrationCache)); |
| 453 | } |
| 454 | |
| 455 | length = mCalibrationCache.size(); |
| 456 | return !mCalibrationCache.empty() ? mCalibrationCache.data() : nullptr; |
| 457 | } |
| 458 | |
| 459 | bool setTensorDynamicRange(INetworkDefinition const& network, float inRange = 2.0F, float outRange = 4.0F) |
| 460 | { |