javierdejesusda commented on code in PR #19772:
URL: https://github.com/apache/tvm/pull/19772#discussion_r3410348124


##########
python/tvm/relax/frontend/onnx/onnx_frontend.py:
##########
@@ -3834,8 +3834,7 @@ def _impl_v17(cls, bb, inputs, attr, params):
         gamma_shape = get_const_tuple(scale.struct_info.shape)
 
         if bias is None:
-            seq_len = data.struct_info.shape[1].value
-            bias = relax.const([0.0] * seq_len, dtype="float32")
+            bias = relax.const(_np.zeros(gamma_shape, 
dtype=scale.struct_info.dtype))

Review Comment:
   Confirmed: np.zeros has no native bfloat16/float8, and the relax.const 
ml_dtypes import only runs after the np.zeros argument is already evaluated, so 
the dtype has to move onto relax.const. Went with the existing torch frontend 
form relax.const(np.zeros(shape), x.struct_info.dtype) rather than a float32 
intermediate, for consistency with the other frontends. Fixed in d06b125.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to