Kevin-XiongC commented on issue #13796:
URL: https://github.com/apache/tvm/issues/13796#issuecomment-1407934995

   > 
   
   ``` python
   import tvm
   from tvm import relay
   from tvm.contrib import graph_executor
   import numpy as np
   x=relay.var("x",shape=[2,2],dtype="float32")
   t1=relay.cast(x,"bool")
   y=relay.sum(t1)
   f = relay.Function([x],relay.Tuple([t1,y]))
   mod = tvm.IRModule({"main":f})
   target = "llvm"
   with tvm.transform.PassContext(opt_level=3):
       lib = relay.build(mod, target=target)
   m = graph_executor.GraphModule(lib['default'](tvm.cpu()))
   x = np.ones((2,2)).astype("float32")
   m.set_input("x",x)
   m.run()
   print(m.get_output(1))
   print(np.sum(x,dtype=bool))
   
   ```
   
   Apologize for my carelessness. Now it should be the issue of relay.sum() 
whose behavior is different from np.sum().
   
   ``` bash 
   False
   True
   ```


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