Lines Matching refs:operand

100 static bool validateOperandExtraParams(const V1_3::Operand& operand, uint32_t index) {  in validateOperandExtraParams()  argument
101 switch (operand.type) { in validateOperandExtraParams()
116 NN_RET_CHECK(operand.extraParams.getDiscriminator() == in validateOperandExtraParams()
119 << getOperandTypeName(operand.type) in validateOperandExtraParams()
120 << " has incorrect extraParams: " << toString(operand.extraParams); in validateOperandExtraParams()
123 NN_RET_CHECK(operand.extraParams.getDiscriminator() == in validateOperandExtraParams()
126 << getOperandTypeName(operand.type) << " without a Channel Quantization params"; in validateOperandExtraParams()
127 auto& channelQuant = operand.extraParams.channelQuant(); in validateOperandExtraParams()
129 size_t count = operand.dimensions.size(); in validateOperandExtraParams()
132 << getOperandTypeName(operand.type) in validateOperandExtraParams()
135 uint32_t expected = operand.dimensions[channelQuant.channelDim]; in validateOperandExtraParams()
138 << getOperandTypeName(operand.type) << " with a wrong-sized scales, " in validateOperandExtraParams()
142 << getOperandTypeName(operand.type) << " channel dimension " in validateOperandExtraParams()
147 << getOperandTypeName(operand.type) << " with a negative value in scales[" in validateOperandExtraParams()
152 if (isExtensionOperandType(operand.type)) { in validateOperandExtraParams()
153 NN_RET_CHECK(operand.extraParams.getDiscriminator() == in validateOperandExtraParams()
155 operand.extraParams.getDiscriminator() == in validateOperandExtraParams()
158 << getOperandTypeName(operand.type) in validateOperandExtraParams()
159 << " has incorrect extraParams: " << toString(operand.extraParams); in validateOperandExtraParams()
183 V1_3::Operand operand = convertToV1_3(versionedOperand); in validateOperands() local
185 switch (operand.type) { in validateOperands()
193 size_t count = operand.dimensions.size(); in validateOperands()
213 operand.lifetime == V1_3::OperandLifeTime::CONSTANT_COPY || in validateOperands()
214 operand.lifetime == V1_3::OperandLifeTime::CONSTANT_REFERENCE) && in validateOperands()
215 operand.dimensions.size() == 0) { in validateOperands()
222 if (!isExtensionOperandType(operand.type)) { in validateOperands()
224 << toString(operand.type); in validateOperands()
231 switch (operand.type) { in validateOperands()
242 if (operand.scale != 0.f) { in validateOperands()
244 << getOperandTypeName(operand.type) << " with a non-zero scale (" in validateOperands()
245 << operand.scale << ")"; in validateOperands()
251 if (operand.scale < 0.f) { in validateOperands()
253 << getOperandTypeName(operand.type) << " with a negative scale"; in validateOperands()
262 if (operand.scale <= 0.f) { in validateOperands()
264 << getOperandTypeName(operand.type) << " with a non-positive scale"; in validateOperands()
269 if (isExtensionOperandType(operand.type) && operand.scale != 0.f) { in validateOperands()
271 << getOperandTypeName(operand.type) << " with a non-zero scale (" in validateOperands()
272 << operand.scale << ")"; in validateOperands()
281 switch (operand.type) { in validateOperands()
294 if (operand.zeroPoint != 0) { in validateOperands()
296 << getOperandTypeName(operand.type) << " with a non-zero zeroPoint " in validateOperands()
297 << operand.zeroPoint; in validateOperands()
302 if (operand.zeroPoint < 0 || operand.zeroPoint > 255) { in validateOperands()
304 << getOperandTypeName(operand.type) << " with an invalid zeroPoint " in validateOperands()
305 << operand.zeroPoint << ", must be in range [0, 255]"; in validateOperands()
310 if (operand.zeroPoint < -128 || operand.zeroPoint > 127) { in validateOperands()
312 << getOperandTypeName(operand.type) << " with an invalid zeroPoint " in validateOperands()
313 << operand.zeroPoint << ", must be in range [-128, 127]"; in validateOperands()
318 if (operand.zeroPoint < 0 || operand.zeroPoint > 65535) { in validateOperands()
320 << getOperandTypeName(operand.type) << " with an invalid zeroPoint " in validateOperands()
321 << operand.zeroPoint << ", must be in range [0, 65535]"; in validateOperands()
326 if (operand.zeroPoint != 0) { in validateOperands()
328 << getOperandTypeName(operand.type) << " with a non-zero zeroPoint " in validateOperands()
329 << operand.zeroPoint; in validateOperands()
334 if (isExtensionOperandType(operand.type) && operand.zeroPoint != 0) { in validateOperands()
336 << getOperandTypeName(operand.type) << " with a non-zero zeroPoint " in validateOperands()
337 << operand.zeroPoint; in validateOperands()
344 NN_RET_CHECK(validateOperandExtraParams(operand, index)); in validateOperands()
347 const V1_0::DataLocation& location = operand.location; in validateOperands()
348 switch (operand.lifetime) { in validateOperands()
378 << toString(operand.lifetime); in validateOperands()
401 << toString(operand.lifetime); in validateOperands()
406 if ((operand.type == V1_3::OperandType::SUBGRAPH) != in validateOperands()
407 (operand.lifetime == V1_3::OperandLifeTime::SUBGRAPH)) { in validateOperands()
408 LOG(ERROR) << "Operand " << index << ": Operand of type " << toString(operand.type) in validateOperands()
409 << " cannot have lifetime " << toString(operand.lifetime); in validateOperands()
415 if (operand.lifetime == V1_3::OperandLifeTime::CONSTANT_REFERENCE || in validateOperands()
416 operand.lifetime == V1_3::OperandLifeTime::CONSTANT_COPY) { in validateOperands()
417 if (!isExtensionOperandType(operand.type) && operand.type != V1_3::OperandType::OEM && in validateOperands()
418 operand.type != V1_3::OperandType::TENSOR_OEM_BYTE) { in validateOperands()
419 uint32_t expectedLength = nonExtensionOperandSizeOfData(operand); in validateOperands()
421 LOG(ERROR) << "Operand " << index << ": For operand " << toString(operand) in validateOperands()
512 const V1_3::Operand& operand = operands[i]; in validateOperations() local
513 if (operand.lifetime != V1_3::OperandLifeTime::TEMPORARY_VARIABLE && in validateOperations()
514 operand.lifetime != V1_3::OperandLifeTime::SUBGRAPH_OUTPUT) { in validateOperations()
516 << toString(operand.lifetime); in validateOperations()
565 const V1_3::Operand& operand = operands[i]; in validateModelInputOutputs() local
566 if (operand.lifetime != lifetime) { in validateModelInputOutputs()
568 << toString(operand.lifetime) << " instead of the expected " in validateModelInputOutputs()
605 const auto& operand = model.operands[i]; in validateGraph() local
606 const V1_3::OperandLifeTime lifetime = convertToV1_3(operand.lifetime); in validateGraph()
682 for (const V1_3::Operand& operand : subgraph.operands) { in checkNoReferenceCycles() local
683 if (operand.lifetime == V1_3::OperandLifeTime::SUBGRAPH) { in checkNoReferenceCycles()
684 uint32_t refSubgraphIndex = operand.location.offset; in checkNoReferenceCycles()
770 const V1_3::Operand& operand = operands[operandIndex]; in validateRequestArguments() local
784 uint32_t modelRank = operand.dimensions.size(); in validateRequestArguments()
790 if (!isExtensionOperandType(operand.type) && in validateRequestArguments()
791 !nonExtensionOperandTypeIsScalar(static_cast<int>(operand.type))) { in validateRequestArguments()
798 if (operand.dimensions[i] == 0) { in validateRequestArguments()
814 if (modelRank != 0 && requestArgument.dimensions[i] != operand.dimensions[i] && in validateRequestArguments()
815 operand.dimensions[i] != 0) { in validateRequestArguments()
819 << " different than the model's " << operand.dimensions[i]; in validateRequestArguments()
917 for (const auto& operand : operands) { in validateMemoryDesc() local
918 NN_RET_CHECK(operand.type == operands[0].type) in validateMemoryDesc()
919 << toString(operand.type) << " vs " << toString(operands[0].type); in validateMemoryDesc()
920 NN_RET_CHECK_EQ(operand.scale, operands[0].scale); in validateMemoryDesc()
921 NN_RET_CHECK_EQ(operand.zeroPoint, operands[0].zeroPoint); in validateMemoryDesc()
924 NN_RET_CHECK(operand.extraParams == operands[0].extraParams) in validateMemoryDesc()
925 << toString(operand.extraParams) << " vs " << toString(operands[0].extraParams); in validateMemoryDesc()
927 const auto combined = combineDimensions(dimensions, operand.dimensions); in validateMemoryDesc()