Lines Matching refs:operand
140 for (size_t operand = 0; operand < model.operands.size(); ++operand) { in mutateOperandTypeTest() local
143 std::to_string(operand) + " set to value " + in mutateOperandTypeTest()
145 validate(device, message, model, [operand, invalidOperandType](Model* model) { in mutateOperandTypeTest()
146 model->operands[operand].type = static_cast<OperandType>(invalidOperandType); in mutateOperandTypeTest()
170 for (size_t operand = 0; operand < model.operands.size(); ++operand) { in mutateOperandRankTest() local
171 const uint32_t invalidRank = getInvalidRank(model.operands[operand].type); in mutateOperandRankTest()
172 const std::string message = "mutateOperandRankTest: operand " + std::to_string(operand) + in mutateOperandRankTest()
174 validate(device, message, model, [operand, invalidRank](Model* model) { in mutateOperandRankTest()
175 model->operands[operand].dimensions = std::vector<uint32_t>(invalidRank, 0); in mutateOperandRankTest()
199 for (size_t operand = 0; operand < model.operands.size(); ++operand) { in mutateOperandScaleTest() local
200 const float invalidScale = getInvalidScale(model.operands[operand].type); in mutateOperandScaleTest()
201 const std::string message = "mutateOperandScaleTest: operand " + std::to_string(operand) + in mutateOperandScaleTest()
203 validate(device, message, model, [operand, invalidScale](Model* model) { in mutateOperandScaleTest()
204 model->operands[operand].scale = invalidScale; in mutateOperandScaleTest()
227 for (size_t operand = 0; operand < model.operands.size(); ++operand) { in mutateOperandZeroPointTest() local
229 getInvalidZeroPoints(model.operands[operand].type); in mutateOperandZeroPointTest()
232 std::to_string(operand) + " has zero point of " + in mutateOperandZeroPointTest()
234 validate(device, message, model, [operand, invalidZeroPoint](Model* model) { in mutateOperandZeroPointTest()
235 model->operands[operand].zeroPoint = invalidZeroPoint; in mutateOperandZeroPointTest()
248 static void mutateOperand(Operand* operand, OperandType type) { in mutateOperand() argument
249 Operand newOperand = *operand; in mutateOperand()
261 operand->dimensions.size() > 0 ? operand->dimensions : hidl_vec<uint32_t>({1}); in mutateOperand()
267 operand->dimensions.size() > 0 ? operand->dimensions : hidl_vec<uint32_t>({1}); in mutateOperand()
272 operand->dimensions.size() > 0 ? operand->dimensions : hidl_vec<uint32_t>({1}); in mutateOperand()
273 newOperand.scale = operand->scale != 0.0f ? operand->scale : 1.0f; in mutateOperand()
280 *operand = newOperand; in mutateOperand()
283 static bool mutateOperationOperandTypeSkip(size_t operand, const V1_1::Model& model) { in mutateOperationOperandTypeSkip() argument
290 if (operation.type == OperationType::LSH_PROJECTION && operand == operation.inputs[1]) { in mutateOperationOperandTypeSkip()
298 for (size_t operand = 0; operand < model.operands.size(); ++operand) { in mutateOperationOperandTypeTest() local
299 if (mutateOperationOperandTypeSkip(operand, model)) { in mutateOperationOperandTypeTest()
304 if (invalidOperandType == model.operands[operand].type || in mutateOperationOperandTypeTest()
310 std::to_string(operand) + " set to type " + in mutateOperationOperandTypeTest()
312 validate(device, message, model, [operand, invalidOperandType](Model* model) { in mutateOperationOperandTypeTest()
313 mutateOperand(&model->operands[operand], invalidOperandType); in mutateOperationOperandTypeTest()
401 for (size_t operand = 0; operand < model.operands.size(); ++operand) { in removeOperandTest() local
402 const std::string message = "removeOperandTest: operand " + std::to_string(operand); in removeOperandTest()
404 [operand](Model* model) { removeOperand(model, operand); }); in removeOperandTest()
411 for (uint32_t operand : model->operations[index].inputs) { in removeOperation() local
412 model->operands[operand].numberOfConsumers--; in removeOperation()
442 uint32_t operand = model->operations[operation].inputs[input]; in removeOperationInputTest() local
443 model->operands[operand].numberOfConsumers--; in removeOperationInputTest()