Fix for tensor_ops.cc

- MATMUL: only check a_zp/b_zp valid when this->qinfo exists
- Fix typo in debug message

Signed-off-by: Kevin Cheng <kevin.cheng@arm.com>
Change-Id: I2cedcb25e4f57fcaec2caa1b850ea1232a023340
diff --git a/reference_model/src/ops/tensor_ops.cc b/reference_model/src/ops/tensor_ops.cc
index 059638a..5494d77 100644
--- a/reference_model/src/ops/tensor_ops.cc
+++ b/reference_model/src/ops/tensor_ops.cc
@@ -92,8 +92,8 @@
         return 1;
     }
 
-    if ( OH != (IH + pad_top + pad_bottom + stride_y - kernel_y) / stride_y ||
-         OW != (IW + pad_left + pad_right + stride_x - kernel_x) / stride_x )
+    if ((OH != (IH + pad_top + pad_bottom + stride_y - kernel_y) / stride_y) ||
+        (OW != (IW + pad_left + pad_right + stride_x - kernel_x) / stride_x))
     {
         msg = "Mismatch between output shape provided and expected output shape";
         return 1;
@@ -453,7 +453,7 @@
     }
 
     ERROR_IF(outputs[0]->getDtype() != AccDtype,
-             "OpFullyConnected: Output data type not supported for this configuration of operator");
+             "OpConv2d: Output data type not supported for this configuration of operator");
 
     input  = dynamic_cast<TosaReference::TensorTemplate<TIn>*>(inputs[0]);
     weight = dynamic_cast<TosaReference::TensorTemplate<TWeight>*>(inputs[1]);
@@ -660,7 +660,7 @@
     }
 
     ERROR_IF(outputs[0]->getDtype() != AccDtype,
-             "OpFullyConnected: Output data type not supported for this configuration of operator");
+             "OpConv3d: Output data type not supported for this configuration of operator");
 
     input  = dynamic_cast<TosaReference::TensorTemplate<TIn>*>(inputs[0]);
     weight = dynamic_cast<TosaReference::TensorTemplate<TWeight>*>(inputs[1]);
@@ -870,7 +870,7 @@
     }
 
     ERROR_IF(outputs[0]->getDtype() != AccDtype,
-             "OpFullyConnected: Output data type not supported for this configuration of operator");
+             "OpDepthwiseConv2d: Output data type not supported for this configuration of operator");
 
     input  = dynamic_cast<TosaReference::TensorTemplate<TIn>*>(inputs[0]);
     weight = dynamic_cast<TosaReference::TensorTemplate<TWeight>*>(inputs[1]);
@@ -1161,7 +1161,7 @@
     }
 
     ERROR_IF(outputs[0]->getDtype() != AccDtype,
-             "OpFullyConnected: Output data type not supported for this configuration of operator");
+             "OpMatMul: Output data type not supported for this configuration of operator");
 
     a      = dynamic_cast<TosaReference::TensorTemplate<TIn>*>(inputs[0]);
     b      = dynamic_cast<TosaReference::TensorTemplate<TIn>*>(inputs[1]);
@@ -1205,7 +1205,7 @@
     }
     W = b->getShape()[2];
 
-    if (Dtype != DType_INT8)
+    if (Dtype != DType_INT8 && this->qinfo)
     {
         ERROR_IF(this->qinfo->a_zp() != 0, "OpMatMul: zeropoint only for int8_t");
         ERROR_IF(this->qinfo->b_zp() != 0, "OpMatMul: zeropoint only for int8_t");
@@ -1436,7 +1436,7 @@
     }
 
     ERROR_IF(outputs[0]->getDtype() != AccDtype,
-             "OpFullyConnected: Output data type not supported for this configuration of operator");
+             "OpTransposeConv2d: Output data type not supported for this configuration of operator");
 
     input  = dynamic_cast<TosaReference::TensorTemplate<TIn>*>(inputs[0]);
     weight = dynamic_cast<TosaReference::TensorTemplate<TWeight>*>(inputs[1]);