Loading neuralnetworks/1.0/vts/functional/VtsHalNeuralnetworksV1_0TargetTest.cpp +21 −6 Original line number Original line Diff line number Diff line Loading @@ -89,6 +89,7 @@ Model createTestModel() { const uint32_t operand1 = 0; const uint32_t operand1 = 0; const uint32_t operand2 = 1; const uint32_t operand2 = 1; const uint32_t operand3 = 2; const uint32_t operand3 = 2; const uint32_t operand4 = 3; const std::vector<Operand> operands = { const std::vector<Operand> operands = { { { Loading @@ -111,6 +112,16 @@ Model createTestModel() { .offset = 0, .offset = 0, .length = size}, .length = size}, }, }, { .type = OperandType::INT32, .dimensions = {}, .numberOfConsumers = 1, .scale = 0.0f, .zeroPoint = 0, .location = {.poolIndex = static_cast<uint32_t>(LocationValues::LOCATION_SAME_BLOCK), .offset = size, .length = sizeof(int32_t)}, }, { { .type = OperandType::TENSOR_FLOAT32, .type = OperandType::TENSOR_FLOAT32, .dimensions = {1, 2, 2, 1}, .dimensions = {1, 2, 2, 1}, Loading @@ -125,15 +136,19 @@ Model createTestModel() { const std::vector<Operation> operations = {{ const std::vector<Operation> operations = {{ .opTuple = {OperationType::ADD, OperandType::TENSOR_FLOAT32}, .opTuple = {OperationType::ADD, OperandType::TENSOR_FLOAT32}, .inputs = {operand1, operand2}, .inputs = {operand1, operand2, operand3}, .outputs = {operand3}, .outputs = {operand4}, }}; }}; const std::vector<uint32_t> inputIndexes = {operand1}; const std::vector<uint32_t> inputIndexes = {operand1}; const std::vector<uint32_t> outputIndexes = {operand3}; const std::vector<uint32_t> outputIndexes = {operand4}; const std::vector<uint8_t> operandValues(reinterpret_cast<const uint8_t*>(operand2Data.data()), std::vector<uint8_t> operandValues( reinterpret_cast<const uint8_t*>(operand2Data.data()) + reinterpret_cast<const uint8_t*>(operand2Data.data()), operand2Data.size() * sizeof(float)); reinterpret_cast<const uint8_t*>(operand2Data.data()) + size); int32_t activation[1] = {0}; operandValues.insert(operandValues.end(), reinterpret_cast<const uint8_t*>(&activation[0]), reinterpret_cast<const uint8_t*>(&activation[1])); const std::vector<hidl_memory> pools = {}; const std::vector<hidl_memory> pools = {}; return { return { Loading Loading
neuralnetworks/1.0/vts/functional/VtsHalNeuralnetworksV1_0TargetTest.cpp +21 −6 Original line number Original line Diff line number Diff line Loading @@ -89,6 +89,7 @@ Model createTestModel() { const uint32_t operand1 = 0; const uint32_t operand1 = 0; const uint32_t operand2 = 1; const uint32_t operand2 = 1; const uint32_t operand3 = 2; const uint32_t operand3 = 2; const uint32_t operand4 = 3; const std::vector<Operand> operands = { const std::vector<Operand> operands = { { { Loading @@ -111,6 +112,16 @@ Model createTestModel() { .offset = 0, .offset = 0, .length = size}, .length = size}, }, }, { .type = OperandType::INT32, .dimensions = {}, .numberOfConsumers = 1, .scale = 0.0f, .zeroPoint = 0, .location = {.poolIndex = static_cast<uint32_t>(LocationValues::LOCATION_SAME_BLOCK), .offset = size, .length = sizeof(int32_t)}, }, { { .type = OperandType::TENSOR_FLOAT32, .type = OperandType::TENSOR_FLOAT32, .dimensions = {1, 2, 2, 1}, .dimensions = {1, 2, 2, 1}, Loading @@ -125,15 +136,19 @@ Model createTestModel() { const std::vector<Operation> operations = {{ const std::vector<Operation> operations = {{ .opTuple = {OperationType::ADD, OperandType::TENSOR_FLOAT32}, .opTuple = {OperationType::ADD, OperandType::TENSOR_FLOAT32}, .inputs = {operand1, operand2}, .inputs = {operand1, operand2, operand3}, .outputs = {operand3}, .outputs = {operand4}, }}; }}; const std::vector<uint32_t> inputIndexes = {operand1}; const std::vector<uint32_t> inputIndexes = {operand1}; const std::vector<uint32_t> outputIndexes = {operand3}; const std::vector<uint32_t> outputIndexes = {operand4}; const std::vector<uint8_t> operandValues(reinterpret_cast<const uint8_t*>(operand2Data.data()), std::vector<uint8_t> operandValues( reinterpret_cast<const uint8_t*>(operand2Data.data()) + reinterpret_cast<const uint8_t*>(operand2Data.data()), operand2Data.size() * sizeof(float)); reinterpret_cast<const uint8_t*>(operand2Data.data()) + size); int32_t activation[1] = {0}; operandValues.insert(operandValues.end(), reinterpret_cast<const uint8_t*>(&activation[0]), reinterpret_cast<const uint8_t*>(&activation[1])); const std::vector<hidl_memory> pools = {}; const std::vector<hidl_memory> pools = {}; return { return { Loading