@@ -129,21 +129,24 @@ def testOnes(self):
129
129
np .tile (np .arange (100 )[:, None , None ] + 1 , [1 , 20 , 50 ]),
130
130
)
131
131
132
- def testOnes_small (self ):
133
132
134
- self .assertAllEqual (
135
- self .evaluate (connected_components (tf .ones ((3 , 5 ), tf .bool ))),
136
- np .ones ((3 , 5 )),
137
- )
133
+ @pytest .mark .usefixtures ("maybe_run_functions_eagerly" )
134
+ def test_ones_small ():
135
+
136
+ np .testing .assert_equal (
137
+ connected_components (tf .ones ((3 , 5 ), tf .bool )).numpy (), np .ones ((3 , 5 )),
138
+ )
138
139
139
- def testRandom_scipy (self ):
140
- np .random .seed (42 )
141
- images = np .random .randint (0 , 2 , size = (10 , 100 , 200 )).astype (np .bool )
142
- expected = connected_components_reference_implementation (images )
143
- if expected is None :
144
- return
145
140
146
- self .assertAllEqual (self .evaluate (connected_components (images )), expected )
141
+ @pytest .mark .usefixtures ("maybe_run_functions_eagerly" )
142
+ def test_random_scipy ():
143
+ np .random .seed (42 )
144
+ images = np .random .randint (0 , 2 , size = (10 , 100 , 200 )).astype (np .bool )
145
+ expected = connected_components_reference_implementation (images )
146
+ if expected is None :
147
+ return
148
+
149
+ np .testing .assert_equal (connected_components (images ).numpy (), expected )
147
150
148
151
149
152
def connected_components_reference_implementation (images ):
0 commit comments