MCPcopy Create free account
hub / github.com/alibaba/MNN / isLinearSample

Function isLinearSample

source/core/ConvolutionCommon.cpp:190–202  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

188}
189
190static bool isLinearSample(const std::vector<int8_t>& sample, int bit) {
191 const int offset = 1 << (bit - 1);
192 const int size = 1 << bit;
193 if (sample.size() != size) {
194 return false;
195 }
196 for (int i = 0; i < sample.size(); i++) {
197 if (static_cast<int>(sample[i]) != i - offset) {
198 return false;
199 }
200 }
201 return true;
202}
203
204static void ReadQuanInfo(BaseLoader* s, size_t* len, ConvolutionCommon::Int8Common* result, bool shapeInt32) {
205 *len = 1;

Callers 1

ReadQuanData_cFunction · 0.85

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected