dlsyscourse / hw1

7 stars 27 forks source link

`__rsub__=__sub__` is a problem? #21

Open BuxianChen opened 1 year ago

BuxianChen commented 1 year ago

I find that in the codebase:

class Tensor(Value):
    __rsub__ = __sub__

Here is a test case:

import needle as ndl
1 - ndl.Tensor([0.5, 2.0, 3.0])   # get needle.Tensor([-0.5  1.   2. ]), which is wrong