Skip to content

Commit

Permalink
Patch missed tensor magic function
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexanderDokuchaev committed Nov 29, 2023
1 parent e17d268 commit 2b7be1b
Showing 1 changed file with 36 additions and 20 deletions.
56 changes: 36 additions & 20 deletions nncf/torch/dynamic_graph/patch_pytorch.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,35 +122,51 @@ class FunctionsToPatchWithoutTracing:
class MagicFunctionsToPatch:
MAGIC_FUNCTIONS_TO_PATCH = {
NamespaceTarget.TORCH_TENSOR: [
"__abs__",
"__add__",
"__iadd__",
"__radd__",
"__sub__",
"__isub__",
"__rsub__",
"__mul__",
"__matmul__",
"__rmatmul__",
"__imul__",
"__rmul__",
"__and__",
"__div__",
"__idiv__",
"__truediv__",
"__eq__",
"__floordiv__",
"__ifloordiv__",
"__rfloordiv__",
"__ge__",
"__getitem__",
"__lt__",
"__le__",
"__gt__",
"__ge__",
"__iadd__",
"__iand__",
"__idiv__",
"__ifloordiv__",
"__imatmul__",
"__imul__",
"__invert__",
"__ior__",
"__ipow__",
"__isub__",
"__itruediv__",
"__ixor__",
"__le__",
"__lt__",
"__matmul__",
"__mod__",
"__eq__",
"__mul__",
"__ne__",
"__neg__",
"__or__",
"__xor__",
"__and__",
"__pow__",
"__radd__",
"__rand__",
"__rdiv__",
"__rdivmod__",
"__rfloordiv__",
"__rmatmul__",
"__rmul__",
"__ror__",
"__rpow__",
"__rsub__",
"__rtruediv__",
"__rxor__",
"__sub__",
"__truediv__",
"__xor__",
]
}

Expand Down

0 comments on commit 2b7be1b

Please sign in to comment.