leandron commented on code in PR #12042:
URL: https://github.com/apache/tvm/pull/12042#discussion_r1018987074


##########
src/relay/qnn/op/dense.cc:
##########
@@ -47,12 +47,14 @@ bool QnnDenseRel(const Array<Type>& types, int num_inputs, 
const Attrs& attrs,
   if (data == nullptr || weight == nullptr) return false;
   const auto* param = attrs.as<DenseAttrs>();
   ICHECK(param != nullptr) << "DenseAttrs cannot be nullptr.";
-  ICHECK(data->dtype == DataType::Int(8) || data->dtype == DataType::UInt(8))
-      << "Expected quantized dense type(int8, uint8) for input but was " << 
data->dtype;
+  ICHECK(data->dtype == DataType::Int(8) || data->dtype == DataType::UInt(8) ||
+         data->dtype == DataType::Int(16) || data->dtype == DataType::UInt(16))
+      << "Expected quantized dense type(int8, uint8, int16, uint16) for input 
but was "
+      << data->dtype;
   ICHECK(weight->dtype == DataType::Int(8) || weight->dtype == 
DataType::UInt(8))
       << "Expected quantized dense type(int8, uint8) for weight but was " << 
weight->dtype;
-  ICHECK(param->out_dtype == DataType::Int(32))
-      << "Expected quantized dense type(int32) for output but was " << 
param->out_dtype;
+  ICHECK(param->out_dtype == DataType::Int(32) || param->out_dtype == 
DataType::Int(64))
+      << "Expected quantized dense type(int32, int64) for output but was " << 
param->out_dtype;

Review Comment:
   Based on the investigation of TFLite int16 networks, the output here will be 
within the checks. Internally, there will be a quantise/requantise just after, 
so that it will set the appropriate output dtype we see in the model, which is 
`int16`.
   
   I double checked the model (the one in the test case in the PR) after 
reading your comment. Also, Conv2D was similarly covered by 
https://github.com/apache/tvm/pull/10915.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to