Skip to content

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

@TennyZhuang

Description

@TennyZhuang

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.

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