MCPcopy Index your code
hub / github.com/apache/tvm / _binary_op_helper

Function _binary_op_helper

python/tvm/relax/expr.py:101–109  ·  view source on GitHub ↗
(lhs: "ExprWithOp", rhs: "ExprWithOp", op: Callable)

Source from the content-addressed store, hash-verified

99
100
101def _binary_op_helper(lhs: "ExprWithOp", rhs: "ExprWithOp", op: Callable) -> "ExprWithOp":
102 if not isinstance(lhs, Expr): # type: ignore
103 raise ValueError("lhs must be Expr")
104 if isinstance(rhs, Expr): # type: ignore
105 return op(lhs, rhs)
106 elif isinstance(rhs, Number):
107 raise TypeError(f"Please convert {rhs} with `const` first")
108 else:
109 raise TypeError(f"type {type(rhs)} not supported")
110
111
112def _binary_rhs_helper(rhs: "ExprWithOp") -> "ExprWithOp":

Callers 11

__lt__Method · 0.85
__gt__Method · 0.85
__ge__Method · 0.85
__le__Method · 0.85
__add__Method · 0.85
__sub__Method · 0.85
__mul__Method · 0.85
__truediv__Method · 0.85
__floordiv__Method · 0.85
__mod__Method · 0.85
__pow__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…