Closed chewxy closed 4 years ago
Source of generated code https://github.com/gorgonia/tensor/blob/master/genlib2/agg2_body.go#L39
So, I had a look at this issue, and fixed this in defaultengine_arith, line 665:
if leftTensor {
retVal = a.Clone().(Tensor)
} else {
retVal = s.(Tensor).Clone().(Tensor)
}
err = e.E.Mul(typ, retVal.hdr(), dataB)
The only thing is that e.E.Mul checks which one of its parameters is scalar and modifies the other one - and modifies the first in case both are scalar. So the output value has to be the leftmost value.
How do I run the genlib2 to regenerate the code?
Fixed so closing
Not fixed correctly yet See https://github.com/gorgonia/tensor/issues/70
@bezineb5 discovered this and opened #51
The bug is described as follows:
The bug happens in https://github.com/gorgonia/tensor/blob/master/defaultengine_arith.go#L665 and https://github.com/gorgonia/tensor/blob/master/defaultengine_arith.go#L639 as well.
The bug affects all generated SV and VS arithmetic functions.