Merge changes from topics "nn_hal_fp16", "comparison_ops"

am: f771d0f183

Change-Id: I58adff431243e0eac262c035284abc2401225b38
This commit is contained in:
Xusong Wang
2018-12-18 16:22:20 -08:00
committed by android-build-merger
2 changed files with 8 additions and 2 deletions

View File

@@ -40,7 +40,7 @@ enum OperandType : @1.0::OperandType {
* scale is a 32 bit floating point with value greater then zero. * scale is a 32 bit floating point with value greater then zero.
*/ */
TENSOR_QUANT16_SYMM = 7, TENSOR_QUANT16_SYMM = 7,
/** A tensor of 16 bit floating point values. */ /** A tensor of IEEE 754 16 bit floating point values. */
TENSOR_FLOAT16 = 8, TENSOR_FLOAT16 = 8,
/** /**
* A tensor of 8 bit boolean values. * A tensor of 8 bit boolean values.
@@ -49,6 +49,8 @@ enum OperandType : @1.0::OperandType {
* represents false; any other value represents true. * represents false; any other value represents true.
*/ */
TENSOR_BOOL8 = 9, TENSOR_BOOL8 = 9,
/** An IEEE 754 16 bit floating point scalar value. */
FLOAT16 = 10,
/* ADDING A NEW FUNDAMENTAL TYPE REQUIRES UPDATING THE VALUE OF /* ADDING A NEW FUNDAMENTAL TYPE REQUIRES UPDATING THE VALUE OF
* OperandTypeRange::OPERAND_FUNDAMENTAL_MAX. * OperandTypeRange::OPERAND_FUNDAMENTAL_MAX.
*/ */
@@ -62,7 +64,7 @@ enum OperandType : @1.0::OperandType {
*/ */
enum OperandTypeRange : uint32_t { enum OperandTypeRange : uint32_t {
OPERAND_FUNDAMENTAL_MIN = 0, OPERAND_FUNDAMENTAL_MIN = 0,
OPERAND_FUNDAMENTAL_MAX = 9, OPERAND_FUNDAMENTAL_MAX = 10,
OPERAND_OEM_MIN = 10000, OPERAND_OEM_MIN = 10000,
OPERAND_OEM_MAX = 10001, OPERAND_OEM_MAX = 10001,
}; };

View File

@@ -151,6 +151,7 @@ static void mutateOperandTypeTest(const sp<IDevice>& device, const Model& model)
static uint32_t getInvalidRank(OperandType type) { static uint32_t getInvalidRank(OperandType type) {
switch (type) { switch (type) {
case OperandType::FLOAT16:
case OperandType::FLOAT32: case OperandType::FLOAT32:
case OperandType::INT32: case OperandType::INT32:
case OperandType::UINT32: case OperandType::UINT32:
@@ -182,6 +183,7 @@ static void mutateOperandRankTest(const sp<IDevice>& device, const Model& model)
static float getInvalidScale(OperandType type) { static float getInvalidScale(OperandType type) {
switch (type) { switch (type) {
case OperandType::FLOAT16:
case OperandType::FLOAT32: case OperandType::FLOAT32:
case OperandType::INT32: case OperandType::INT32:
case OperandType::UINT32: case OperandType::UINT32:
@@ -214,6 +216,7 @@ static void mutateOperandScaleTest(const sp<IDevice>& device, const Model& model
static std::vector<int32_t> getInvalidZeroPoints(OperandType type) { static std::vector<int32_t> getInvalidZeroPoints(OperandType type) {
switch (type) { switch (type) {
case OperandType::FLOAT16:
case OperandType::FLOAT32: case OperandType::FLOAT32:
case OperandType::INT32: case OperandType::INT32:
case OperandType::UINT32: case OperandType::UINT32:
@@ -257,6 +260,7 @@ static void mutateOperand(Operand* operand, OperandType type) {
Operand newOperand = *operand; Operand newOperand = *operand;
newOperand.type = type; newOperand.type = type;
switch (type) { switch (type) {
case OperandType::FLOAT16:
case OperandType::FLOAT32: case OperandType::FLOAT32:
case OperandType::INT32: case OperandType::INT32:
case OperandType::UINT32: case OperandType::UINT32: