Skip to content

Commit 674f457

Browse files
committed
wrap in enum.member
1 parent 9c91d4a commit 674f457

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tests/tests_pytorch/strategies/test_ddp_integration_comm_hook.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14+
import sys
15+
from enum import member
1416
from unittest import mock
1517

1618
import pytest
@@ -23,6 +25,9 @@
2325

2426
if torch.distributed.is_available():
2527
import torch.distributed.algorithms.ddp_comm_hooks.post_localSGD_hook as post_localSGD
28+
29+
if sys.version_info >= (3, 13):
30+
post_localSGD = member(post_localSGD)
2631
from torch.distributed.algorithms.ddp_comm_hooks import default_hooks as default
2732
from torch.distributed.algorithms.ddp_comm_hooks import powerSGD_hook as powerSGD
2833

0 commit comments

Comments
 (0)