From de85170ddd1b15b4e19d6f9416e269bfdc3db383 Mon Sep 17 00:00:00 2001 From: Xuehai Pan Date: Sun, 9 Feb 2025 22:38:06 +0800 Subject: [PATCH] Update (base update) [ghstack-poisoned] --- test/test_fx.py | 5 +---- torch/utils/_cxx_pytree.py | 2 ++ torch/utils/_pytree.py | 2 ++ 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/test/test_fx.py b/test/test_fx.py index a0cd1f6d1d2..a955ba5227e 100644 --- a/test/test_fx.py +++ b/test/test_fx.py @@ -32,10 +32,7 @@ from fx.test_fx_const_fold import TestConstFold # noqa: F401 from fx.test_fx_param_shape_control_flow import ( # noqa: F401 TestConstParamShapeInControlFlow, ) -from fx.test_gradual_type import ( # noqa: F401 # noqa: F401 - AnnotationsTest, - TypeCheckerTest, -) +from fx.test_gradual_type import AnnotationsTest, TypeCheckerTest # noqa: F401 from fx.test_matcher_utils import TestMatcher # noqa: F401 from fx.test_pass_infra import TestPassManager # noqa: F401 from fx.test_source_matcher_utils import TestSourceMatcher # noqa: F401 diff --git a/torch/utils/_cxx_pytree.py b/torch/utils/_cxx_pytree.py index 407c18f4cf0..5964fa38238 100644 --- a/torch/utils/_cxx_pytree.py +++ b/torch/utils/_cxx_pytree.py @@ -992,6 +992,8 @@ def treespec_loads(serialized: str) -> TreeSpec: class _Asterisk(str): + __slots__ = () + def __new__(cls) -> Self: return super().__new__(cls, "*") diff --git a/torch/utils/_pytree.py b/torch/utils/_pytree.py index 844fbeb5186..860b7f95139 100644 --- a/torch/utils/_pytree.py +++ b/torch/utils/_pytree.py @@ -1634,6 +1634,8 @@ def treespec_loads(serialized: str) -> TreeSpec: class _Asterisk(str): + __slots__ = () + def __new__(cls) -> Self: return super().__new__(cls, "*")