padreofthegame commented on issue #13796:
URL: https://github.com/apache/tvm/issues/13796#issuecomment-1449113893

   Yeah @masahi, you are absolutely right. In my opinion `xor` is is also 
considerable as the some kind of sum operator in boolean algebra. 
   
   But one more observation I came up today working on PR is that numpy 
actually doesn't care about the fact that the input data are of type boolean. 
It looks like it consider them as zeroes and ones, and it just accumulate 
corresponding values for True and False. For example, it even  this 
   
   `np.sum(np.array([[True, True], [True, True]]), axis = ())` 
   
   evaluates as
   
   `array([[1, 1],`
   `          [1, 1]])`
   
   So looking at the example reported in this issue 
(`print(np.sum(x,dtype=bool))`), it may be reasonable to think that in this 
case numpy do additional cast operation after summation, and maybe better 
option here, from the aspect of topi.sum or relay.sum, would be to interpret 
all boolean data as integer values 0 or 1, and keep the current realization of 
sum function?


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