Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement __matmul__ builtin magic method instead of calling matmul_op directly #3

Open
TennyZhuang opened this issue Aug 22, 2017 · 0 comments

Comments

@TennyZhuang
Copy link
Contributor

about __matmul__, __rmatmul__, see PEP 465

similar to Node.__add__ and Node.__mul__

This is a new infix operator from Python 3.5, it's recommended by Python in math library.

numpy ndarray support this operator.

    x2 = ad.Variable(name = "x2")
    x3 = ad.Variable(name = "x3")
    # y = ad.matmul_op(x2, x3)
    y = x2 @ x2

Incompatible change, maybe better for next term.

@TennyZhuang TennyZhuang changed the title Implement __matmul__ builtin magic method instead of matmul_op Implement __matmul__ builtin magic method instead of calling matmul_op directly Aug 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant