Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2eb64da commit badf311Copy full SHA for badf311
1 file changed
apex/contrib/test/group_norm/test_group_norm.py
@@ -18,6 +18,7 @@
18
import functools
19
import importlib
20
import pathlib
21
+import sys
22
import torch
23
import unittest
24
@@ -202,7 +203,12 @@ def test_group_norm_inductor(self):
202
203
y.backward(dy)
204
205
from torch._dynamo.utils import counters
- self.assertNotIn('graph_break', counters, "Shouldn't see any graph breaks.")
206
+ # TODO: Remove this when 3.9 is no longer supported
207
+ if sys.version_info < (3, 10):
208
+ num_graph_breaks = sum(counters["graph_break"].values())
209
+ else:
210
+ num_graph_breaks = counters["graph_break"].total()
211
+ self.assertEqual(num_graph_breaks, 0, "Shouldn't see any graph breaks.")
212
self.assertEqual(counters['stats']['unique_graphs'], 1, "Expect only one graph.")
213
214
def test_16_groups(self):
0 commit comments