Merge "Support don't care outputs in VTS tests" into oc-mr1-dev
diff --git a/nn/common/CpuExecutor.cpp b/nn/common/CpuExecutor.cpp
index d6b5e8c..578263f 100644
--- a/nn/common/CpuExecutor.cpp
+++ b/nn/common/CpuExecutor.cpp
@@ -84,7 +84,7 @@
     info->type = shape.type;
     info->dimensions = shape.dimensions;
     info->scale = shape.scale;
-    info->offset = shape.offset;
+    info->zeroPoint = shape.offset;
     if (info->buffer == nullptr) {
         uint32_t length = sizeOfData(info->type, info->dimensions);
         info->buffer = new uint8_t[length];
@@ -140,7 +140,7 @@
         to.type = from.type;
         to.dimensions = from.dimensions;
         to.scale = from.scale;
-        to.offset = from.zeroPoint;
+        to.zeroPoint = from.zeroPoint;
         to.length = from.location.length;
         switch (from.lifetime) {
             case OperandLifeTime::TEMPORARY_VARIABLE:
diff --git a/nn/common/include/CpuExecutor.h b/nn/common/include/CpuExecutor.h
index 60ca5d4..2393368 100644
--- a/nn/common/include/CpuExecutor.h
+++ b/nn/common/include/CpuExecutor.h
@@ -38,7 +38,7 @@
     std::vector<uint32_t> dimensions;
 
     float scale;
-    int32_t offset;  // TODO rename zeroValue
+    int32_t zeroPoint;
     // Where the operand's data is stored.  Check the corresponding
     // location information in the model to figure out if this points
     // to memory we have allocated for an temporary operand.
@@ -55,7 +55,7 @@
         return Shape{.type = type,
                      .dimensions = dimensions,
                      .scale = scale,
-                     .offset = offset};
+                     .offset = zeroPoint};
     }
 };
 
diff --git a/nn/runtime/ModelBuilder.cpp b/nn/runtime/ModelBuilder.cpp
index ff4abec..fcab958 100644
--- a/nn/runtime/ModelBuilder.cpp
+++ b/nn/runtime/ModelBuilder.cpp
@@ -47,7 +47,7 @@
     setFromIntList(&operand.dimensions, type.dimensionCount, type.dimensions);
     operand.numberOfConsumers = 0;
     operand.scale = type.scale;
-    operand.zeroPoint = type.offset;
+    operand.zeroPoint = type.zeroPoint;
     operand.lifetime = OperandLifeTime::TEMPORARY_VARIABLE;
     operand.location = {.poolIndex = 0, .offset = 0, .length = 0};
     return ANEURALNETWORKS_NO_ERROR;
diff --git a/nn/runtime/include/NeuralNetworks.h b/nn/runtime/include/NeuralNetworks.h
index 0d9703c..66fe64a 100644
--- a/nn/runtime/include/NeuralNetworks.h
+++ b/nn/runtime/include/NeuralNetworks.h
@@ -1171,7 +1171,7 @@
      * The dequantized value of each entry is (value - offset) * scale.
      */
     float scale;
-    int32_t offset;
+    int32_t zeroPoint;
 } ANeuralNetworksOperandType;
 
 typedef int32_t ANeuralNetworksOperationType;
diff --git a/nn/runtime/include/NeuralNetworksWrapper.h b/nn/runtime/include/NeuralNetworksWrapper.h
index 37ddb7a..1da93bd 100644
--- a/nn/runtime/include/NeuralNetworksWrapper.h
+++ b/nn/runtime/include/NeuralNetworksWrapper.h
@@ -59,7 +59,7 @@
     OperandType(Type type, const std::vector<uint32_t>& d) : dimensions(d) {
         operandType.type = static_cast<int32_t>(type);
         operandType.scale = 0.0f;
-        operandType.offset = 0;
+        operandType.zeroPoint = 0;
 
         operandType.dimensionCount = static_cast<uint32_t>(dimensions.size());
         operandType.dimensions = dimensions.data();
@@ -75,11 +75,11 @@
         uint8_t q_max = std::numeric_limits<uint8_t>::max();
         float range = q_max - q_min;
         float scale = (f_max - f_min) / range;
-        int32_t offset =
+        int32_t zeroPoint =
                     fmin(q_max, fmax(q_min, static_cast<uint8_t>(round(q_min - f_min / scale))));
 
         operandType.scale = scale;
-        operandType.offset = offset;
+        operandType.zeroPoint = zeroPoint;
     }
 };