Skip to content

__rsub__=__sub__ is a problem? #21

@BuxianChen

Description

@BuxianChen

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions