kice opened a new issue #3879:
URL: https://github.com/apache/incubator-tvm/issues/3879


   Example code
   
   ```python
   expr_text = """v0.0.3
   fn(%data: Tensor[(1, 1, 1, 1), uint8]) -> Tensor[(1, 1, 1, 1), uint8] {
     %0 = cast(%data, dtype="float16");
     cast(%0, dtype="uint8")
   }
   """
   
   func = relay.parser.fromtext(expr_text)
   
   with relay.build_config(opt_level=3):
       graph, lib, params = relay.build(func, target='cuda')
   ```
   
   Output:
   ```
   my_kernel.cu(4): error: more than one conversion function from "half" to 
"unsigned char" applies:
               function "__half::operator float() const"
               function "__half::operator short() const"
               function "__half::operator unsigned short() const"
               function "__half::operator int() const"
               function "__half::operator unsigned int() const"
               function "__half::operator long long() const"
               function "__half::operator unsigned long long() const"
               function "__half::operator __nv_bool() const"
   ```
   
   After looking into cuda_fp16.h, found that no direct conversion from fp16 to 
uint8/int8.
   
   Suggest to warn the user who want to this conversion, or conver it to 
uint16/int16 and then to uint8/int8 internally.
   
   You may close this issue after reading.
   
   P.S. I am sorry that I open too many small PRs and issues in short period of 
time. xD


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

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


Reply via email to