(defparameter int-tensor (magicl:from-list '(1 2 3) '(3)))
(defparameter float-tensor (magicl:from-list '(1.0 2.0 3.0) '(3)))
;; This works
(magicl:.+ float-tensor int-tensor)
;; This is a TYPE-ERROR condition
(magicl:.+ int-tensor float-tensor)
A solution would be to coerce/round/cast one of the arguments, but which one, and when?
Take an example of elementwise sum and the cases of 0.5 + 1 being stored in an int32-tensor. Depending on where, say, the round function is applied the first sum could be
I'm not even convinced this is a bug or appropriate behaviour...
Depending on the order of arguments we can get a type-error from [the setf] (https://github.com/quil-lang/magicl/blob/master/src/high-level/abstract-tensor.lisp#L197=) in
binary-operator
A solution would be to coerce/round/cast one of the arguments, but which one, and when?
Take an example of elementwise sum and the cases of
0.5 + 1
being stored in anint32
-tensor. Depending on where, say, theround
function is applied the first sum could be