MCPcopy Create free account
hub / github.com/JDAI-CV/DNNLibrary / OperandType

Method OperandType

dnnlibrary/NeuralNetworksWrapper.cpp:9–26  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7namespace wrapper {
8
9OperandType::OperandType(Type type, std::vector<uint32_t> d, float scale,
10 int32_t zeroPoint)
11 : type(type), dimensions(std::move(d)), channelQuant(dnn::nullopt) {
12 if (dimensions.empty()) {
13 if (!isScalarType(type)) {
14 dimensions = {1};
15 }
16 } else {
17 DNN_ASSERT(!isScalarType(type), typeToStr(type), " ", dimensions);
18 }
19 operandType = {
20 .type = static_cast<int32_t>(type),
21 .dimensionCount = static_cast<uint32_t>(dimensions.size()),
22 .dimensions = dimensions.size() > 0 ? dimensions.data() : nullptr,
23 .scale = scale,
24 .zeroPoint = zeroPoint,
25 };
26}
27OperandType::OperandType(Type type, std::vector<uint32_t> data, float scale,
28 int32_t zeroPoint,
29 SymmPerChannelQuantParams&& channelQuant)

Callers

nothing calls this directly

Calls 3

isScalarTypeFunction · 0.85
typeToStrFunction · 0.85
sizeMethod · 0.80

Tested by

no test coverage detected