Lunderberg opened a new pull request, #16563:
URL: https://github.com/apache/tvm/pull/16563

   Relax is capable of expressing tensors whose element type is unknown.  
However, these must typically be replaced with a known dtype prior to 
compilation, as most operators require known data types prior to legalization.  
This can be done by using a `relax::MatchCast` node, such as accepting a 
parameter `arg: R.Tensor([16,16])`, then defining the dtype using 
`R.match_cast(arg, R.Tensor([16,16],'float16'))`.
   
   However, using a `R.match_cast` node requires knowing which data type should 
be used in the new `R.Tensor`, and raises an error for an incorrect data type.  
If an argument may be one of two distinct data types, `R.match_cast` cannot be 
used to check which data type is in use.
   
   This commit adds Relax operators to read the runtime values of a `DLTensor*` 
argument.  These can be be used to normalize arguments prior to a compute step. 
 For example, pre-processing a model weight that may be provided in either 
`float16` or `bfloat16` format.


-- 
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: commits-unsubscr...@tvm.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to