Loading neuralnetworks/1.2/types.hal +5 −7 Original line number Diff line number Diff line Loading @@ -33,15 +33,13 @@ enum OperandType : @1.0::OperandType { /** * A tensor of 16 bit signed integers that represent real numbers. * * Attached to this tensor are two numbers that are used to convert the 16 * bit integer to the real value and vice versa. These two numbers are: * - scale: a 32 bit floating point value greater than zero. * - zeroPoint: a 32 bit integer, in range [-32768, 32767]. * Attached to this tensor is a number representing real value scale that is * used to convert the 16 bit number to a real value in the following way: * realValue = integerValue * scale. * * The formula is: * realValue = (integerValue - zeroPoint) * scale. * scale is a 32 bit floating point with value greater then zero. */ TENSOR_QUANT16_ASYMM = 7, TENSOR_QUANT16_SYMM = 7, /** A tensor of 16 bit floating point values. */ TENSOR_FLOAT16 = 8, }; Loading neuralnetworks/1.2/vts/functional/ValidateModel.cpp +5 −5 Original line number Diff line number Diff line Loading @@ -161,7 +161,7 @@ static uint32_t getInvalidRank(OperandType type) { case OperandType::TENSOR_FLOAT32: case OperandType::TENSOR_INT32: case OperandType::TENSOR_QUANT8_ASYMM: case OperandType::TENSOR_QUANT16_ASYMM: case OperandType::TENSOR_QUANT16_SYMM: return 0; default: return 0; Loading Loading @@ -193,7 +193,7 @@ static float getInvalidScale(OperandType type) { case OperandType::TENSOR_INT32: return -1.0f; case OperandType::TENSOR_QUANT8_ASYMM: case OperandType::TENSOR_QUANT16_ASYMM: case OperandType::TENSOR_QUANT16_SYMM: return 0.0f; default: return 0.0f; Loading Loading @@ -225,8 +225,8 @@ static std::vector<int32_t> getInvalidZeroPoints(OperandType type) { return {1}; case OperandType::TENSOR_QUANT8_ASYMM: return {-1, 256}; case OperandType::TENSOR_QUANT16_ASYMM: return {-32769, 32768}; case OperandType::TENSOR_QUANT16_SYMM: return {-32769, -1, 1, 32768}; default: return {}; } Loading Loading @@ -279,7 +279,7 @@ static void mutateOperand(Operand* operand, OperandType type) { newOperand.zeroPoint = 0; break; case OperandType::TENSOR_QUANT8_ASYMM: case OperandType::TENSOR_QUANT16_ASYMM: case OperandType::TENSOR_QUANT16_SYMM: newOperand.dimensions = operand->dimensions.size() > 0 ? operand->dimensions : hidl_vec<uint32_t>({1}); newOperand.scale = operand->scale != 0.0f ? operand->scale : 1.0f; Loading Loading
neuralnetworks/1.2/types.hal +5 −7 Original line number Diff line number Diff line Loading @@ -33,15 +33,13 @@ enum OperandType : @1.0::OperandType { /** * A tensor of 16 bit signed integers that represent real numbers. * * Attached to this tensor are two numbers that are used to convert the 16 * bit integer to the real value and vice versa. These two numbers are: * - scale: a 32 bit floating point value greater than zero. * - zeroPoint: a 32 bit integer, in range [-32768, 32767]. * Attached to this tensor is a number representing real value scale that is * used to convert the 16 bit number to a real value in the following way: * realValue = integerValue * scale. * * The formula is: * realValue = (integerValue - zeroPoint) * scale. * scale is a 32 bit floating point with value greater then zero. */ TENSOR_QUANT16_ASYMM = 7, TENSOR_QUANT16_SYMM = 7, /** A tensor of 16 bit floating point values. */ TENSOR_FLOAT16 = 8, }; Loading
neuralnetworks/1.2/vts/functional/ValidateModel.cpp +5 −5 Original line number Diff line number Diff line Loading @@ -161,7 +161,7 @@ static uint32_t getInvalidRank(OperandType type) { case OperandType::TENSOR_FLOAT32: case OperandType::TENSOR_INT32: case OperandType::TENSOR_QUANT8_ASYMM: case OperandType::TENSOR_QUANT16_ASYMM: case OperandType::TENSOR_QUANT16_SYMM: return 0; default: return 0; Loading Loading @@ -193,7 +193,7 @@ static float getInvalidScale(OperandType type) { case OperandType::TENSOR_INT32: return -1.0f; case OperandType::TENSOR_QUANT8_ASYMM: case OperandType::TENSOR_QUANT16_ASYMM: case OperandType::TENSOR_QUANT16_SYMM: return 0.0f; default: return 0.0f; Loading Loading @@ -225,8 +225,8 @@ static std::vector<int32_t> getInvalidZeroPoints(OperandType type) { return {1}; case OperandType::TENSOR_QUANT8_ASYMM: return {-1, 256}; case OperandType::TENSOR_QUANT16_ASYMM: return {-32769, 32768}; case OperandType::TENSOR_QUANT16_SYMM: return {-32769, -1, 1, 32768}; default: return {}; } Loading Loading @@ -279,7 +279,7 @@ static void mutateOperand(Operand* operand, OperandType type) { newOperand.zeroPoint = 0; break; case OperandType::TENSOR_QUANT8_ASYMM: case OperandType::TENSOR_QUANT16_ASYMM: case OperandType::TENSOR_QUANT16_SYMM: newOperand.dimensions = operand->dimensions.size() > 0 ? operand->dimensions : hidl_vec<uint32_t>({1}); newOperand.scale = operand->scale != 0.0f ? operand->scale : 1.0f; Loading