Hzfengsy commented on a change in pull request #10112:
URL: https://github.com/apache/tvm/pull/10112#discussion_r803273135



##########
File path: src/relay/op/nn/nn.cc
##########
@@ -1177,7 +1177,8 @@ bool NLLLossRel(const Array<Type>& types, int num_inputs, 
const Attrs& attrs,
                                      << ", weights shape = " << 
weights->shape);
     return false;
   }
-  if (!(predictions->dtype == weights->dtype && 
predictions->dtype.is_float())) {
+  if (!(predictions->dtype == weights->dtype &&
+        (predictions->dtype.is_float() || predictions->dtype.is_bfloat16()))) {

Review comment:
       Shall we let `is_float()` be true for `bfloat16` exprs?

##########
File path: src/relay/backend/utils.h
##########
@@ -302,6 +302,8 @@ inline std::string DType2String(const tvm::DataType dtype) {
     os << "int";
   } else if (dtype.is_uint()) {
     os << "uint";
+  } else if (dtype.is_bfloat16()) {
+    os << "bfloat";

Review comment:
       ```suggestion
       os << "bfloat16";
   ```




-- 
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