Skip to content

Commit

Permalink
Skip side effect tracking for c wrappers/descriptors (#129914)
Browse files Browse the repository at this point in the history
Summary:
Fixes PYTORCH_TEST_WITH_DYNAMO=1 pytest -vs test/test_python_dispatch.py::TestPythonDispatch::test_deepcopy_wrapper_subclass

X-link: pytorch/pytorch#129914
Approved by: https://github.com/jansel
ghstack dependencies: #129913

Reviewed By: kit1980

Differential Revision: D59413617

Pulled By: anijain2305

fbshipit-source-id: 4fd93621fbe0f6480ed3d8b7aeece0335f6b50e2
  • Loading branch information
anijain2305 authored and facebook-github-bot committed Jul 6, 2024
1 parent 7cbf487 commit 8649e6c
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions userbenchmark/dynamo/dynamobench/_dynamo/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -582,6 +582,17 @@ def is_function(value):
)


def is_wrapper_or_member_descriptor(value):
return isinstance(
value,
(
types.MethodWrapperType,
types.WrapperDescriptorType,
types.MemberDescriptorType,
),
)


def unwrap_if_wrapper(fn):
return unwrap_with_attr_name_if_wrapper(fn)[0]

Expand Down

0 comments on commit 8649e6c

Please sign in to comment.