comaniac commented on code in PR #11902:
URL: https://github.com/apache/tvm/pull/11902#discussion_r907609150


##########
python/tvm/contrib/dnnl.py:
##########
@@ -113,6 +113,17 @@ def dnnl_conv2d(
     else:
         dilation_h, dilation_w = dilation
 
+    pre_cast = False
+    post_cast = False
+    if src.dtype == "float32":
+        pre_cast = True
+    elif src.dtype == "bfloat16":
+        pre_cast = False
+    if out_dtype == "float32":
+        post_cast = True
+    elif out_dtype == "bfloat16":
+        post_cast = False

Review Comment:
   ```suggestion
       pre_cast = src.dtype == "float32"
       post_cast = out_dtype == "float32"
   ```



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