Skip to content

Commit

Permalink
Fixed ordering of right side reversed operators
Browse files Browse the repository at this point in the history
  • Loading branch information
JadenFiotto-Kaufman committed Jan 3, 2024
1 parent d8af49b commit 8e91538
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/nnsight/tracing/Proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def __add__(self, other: Union[Proxy, Any]) -> Proxy:
def __radd__(self, other: Union[Proxy, Any]) -> Proxy:
return self.node.graph.add(
target=operator.add,
args=[self.node, other],
args=[other, self.node],
)

def __sub__(self, other: Union[Proxy, Any]) -> Proxy:
Expand All @@ -115,7 +115,7 @@ def __sub__(self, other: Union[Proxy, Any]) -> Proxy:
def __rsub__(self, other: Union[Proxy, Any]) -> Proxy:
return self.node.graph.add(
target=operator.sub,
args=[self.node, other],
args=[other, self.node],
)

def __pow__(self, other: Union[Proxy, Any]) -> Proxy:
Expand All @@ -127,7 +127,7 @@ def __pow__(self, other: Union[Proxy, Any]) -> Proxy:
def __rpow__(self, other: Union[Proxy, Any]) -> Proxy:
return self.node.graph.add(
target=operator.pow,
args=[self.node, other],
args=[other, self.node],
)

def __mul__(self, other: Union[Proxy, Any]) -> Proxy:
Expand All @@ -139,7 +139,7 @@ def __mul__(self, other: Union[Proxy, Any]) -> Proxy:
def __rmul__(self, other: Union[Proxy, Any]) -> Proxy:
return self.node.graph.add(
target=operator.mul,
args=[self.node, other],
args=[other, self.node],
)

def __mod__(self, other: Union[Proxy, Any]) -> Proxy:
Expand All @@ -151,7 +151,7 @@ def __mod__(self, other: Union[Proxy, Any]) -> Proxy:
def __rmod__(self, other: Union[Proxy, Any]) -> Proxy:
return self.node.graph.add(
target=operator.mod,
args=[self.node, other],
args=[other, self.node],
)

def __matmul__(self, other: Union[Proxy, Any]) -> Proxy:
Expand All @@ -163,7 +163,7 @@ def __matmul__(self, other: Union[Proxy, Any]) -> Proxy:
def __rmatmul__(self, other: Union[Proxy, Any]) -> Proxy:
return self.node.graph.add(
target=operator.matmul,
args=[self.node, other],
args=[other, self.node],
)

def __truediv__(self, other: Union[Proxy, Any]) -> Proxy:
Expand All @@ -175,7 +175,7 @@ def __truediv__(self, other: Union[Proxy, Any]) -> Proxy:
def __rtruediv__(self, other: Union[Proxy, Any]) -> Proxy:
return self.node.graph.add(
target=operator.truediv,
args=[self.node, other],
args=[other, self.node],
)

def __bool__(self) -> bool:
Expand Down

0 comments on commit 8e91538

Please sign in to comment.