File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed
com.ibm.wala.cast.python.test/data Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,23 @@ def f(a):
77 pass
88
99
10- x = tf .ragged .constant ([[1.0 , 2.0 ], [3.0 ]])
10+ arg = [[1.0 , 2.0 ], [3.0 ]]
11+ assert isinstance (arg , list )
12+ assert isinstance (arg [0 ], list )
13+ assert isinstance (arg [0 ][0 ], float )
14+ assert isinstance (arg [1 ], list )
15+ assert isinstance (arg [1 ][0 ], float )
16+ assert all (isinstance (item , float ) for sublist in arg for item in sublist )
17+ assert all (isinstance (sublist , list ) for sublist in arg )
18+ assert len (arg ) == 2
19+ assert len (arg [0 ]) == 2
20+ assert len (arg [1 ]) == 1
21+
22+ x = tf .ragged .constant (arg )
23+ assert isinstance (x , tf .RaggedTensor )
24+ assert x .shape == (2 , None )
25+ assert x .dtype == tf .float32
26+
1127with tf .GradientTape () as g :
1228 g .watch (x )
1329 y = x * x
You can’t perform that action at this time.
0 commit comments