File tree 1 file changed +8
-2
lines changed
1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -5495,7 +5495,10 @@ def testDeterministicDropoutLayer(self):
5495
5495
np .isclose (x_val , 0.0 ), np .isclose (x_val , 1.0 / 0.7 ))))
5496
5496
# Check that values contain 0 but are not all 0.
5497
5497
self .assertTrue (
5498
- 0 < np .sum (np .cast [np .int32 ](np .isclose (x_val , 0.0 ))) < x_val .size )
5498
+ 0
5499
+ < np .sum (np .asarray (np .isclose (x_val , 0.0 ), dtype = np .int32 ))
5500
+ < x_val .size
5501
+ )
5499
5502
5500
5503
# Different step seed gives different result.
5501
5504
x_val = self .evaluate (dropout .FPropDefaultTheta (x ))
@@ -5555,7 +5558,10 @@ def testNoiseShapeBroadcastDims(self):
5555
5558
1.0 / 0.7 ))))
5556
5559
# Check that values contain 0 but are not all 0.
5557
5560
self .assertTrue (
5558
- 0 < np .sum (np .cast [np .int32 ](np .isclose (x_val , 0.0 ))) < x_val .size )
5561
+ 0
5562
+ < np .sum (np .asarray (np .isclose (x_val , 0.0 ), dtype = np .int32 ))
5563
+ < x_val .size
5564
+ )
5559
5565
# Check that each row has the same value.
5560
5566
self .assertAllClose (np .broadcast_to (x_val [:, :1 ], x_val .shape ), x_val )
5561
5567
You can’t perform that action at this time.
0 commit comments