@@ -95,11 +95,11 @@ def test_negation(test, device, dtype, register_kernels=False):
9595 output_select_kernel = get_select_kernel (kernel_cache , wptype )
9696
9797 def check_mat_negation (
98- m2 : wp .array ( dtype = mat22 ) ,
99- m3 : wp .array ( dtype = mat33 ) ,
100- m4 : wp .array ( dtype = mat44 ) ,
101- m5 : wp .array ( dtype = mat55 ) ,
102- outcomponents : wp .array ( dtype = wptype ) ,
98+ m2 : wp .array [ mat22 ] ,
99+ m3 : wp .array [ mat33 ] ,
100+ m4 : wp .array [ mat44 ] ,
101+ m5 : wp .array [ mat55 ] ,
102+ outcomponents : wp .array [ wptype ] ,
103103 ):
104104 mat2 = - m2 [0 ]
105105 mat3 = - m3 [0 ]
@@ -185,12 +185,12 @@ def test_matmul(test, device, dtype, register_kernels=False):
185185 output_select_kernel = get_select_kernel (kernel_cache , wptype )
186186
187187 def check_mat_mul (
188- i23 : wp .array ( dtype = mat23 ) ,
189- i32 : wp .array ( dtype = mat32 ) ,
190- i44 : wp .array ( dtype = mat44 ) ,
191- o22 : wp .array ( dtype = mat22 ) ,
192- o33 : wp .array ( dtype = mat33 ) ,
193- o44 : wp .array ( dtype = mat44 ) ,
188+ i23 : wp .array [ mat23 ] ,
189+ i32 : wp .array [ mat32 ] ,
190+ i44 : wp .array [ mat44 ] ,
191+ o22 : wp .array [ mat22 ] ,
192+ o33 : wp .array [ mat33 ] ,
193+ o44 : wp .array [ mat44 ] ,
194194 ):
195195 i = wp .tid ()
196196 o22 [i ] = i23 [i ] @ i32 [i ]
@@ -255,15 +255,15 @@ def test_subtraction(test, device, dtype, register_kernels=False):
255255 output_select_kernel = get_select_kernel (kernel_cache , wptype )
256256
257257 def check_mat_sub (
258- s2 : wp .array ( dtype = mat22 ) ,
259- s3 : wp .array ( dtype = mat33 ) ,
260- s4 : wp .array ( dtype = mat44 ) ,
261- s5 : wp .array ( dtype = mat55 ) ,
262- v2 : wp .array ( dtype = mat22 ) ,
263- v3 : wp .array ( dtype = mat33 ) ,
264- v4 : wp .array ( dtype = mat44 ) ,
265- v5 : wp .array ( dtype = mat55 ) ,
266- outcomponents : wp .array ( dtype = wptype ) ,
258+ s2 : wp .array [ mat22 ] ,
259+ s3 : wp .array [ mat33 ] ,
260+ s4 : wp .array [ mat44 ] ,
261+ s5 : wp .array [ mat55 ] ,
262+ v2 : wp .array [ mat22 ] ,
263+ v3 : wp .array [ mat33 ] ,
264+ v4 : wp .array [ mat44 ] ,
265+ v5 : wp .array [ mat55 ] ,
266+ outcomponents : wp .array [ wptype ] ,
267267 ):
268268 v2result = v2 [0 ] - s2 [0 ]
269269 v3result = v3 [0 ] - s3 [0 ]
@@ -373,12 +373,12 @@ def test_determinant(test, device, dtype, register_kernels=False):
373373 mat44 = wp .types .matrix (shape = (4 , 4 ), dtype = wptype )
374374
375375 def check_mat_det (
376- v2 : wp .array ( dtype = mat22 ) ,
377- v3 : wp .array ( dtype = mat33 ) ,
378- v4 : wp .array ( dtype = mat44 ) ,
379- det2 : wp .array ( dtype = wptype ) ,
380- det3 : wp .array ( dtype = wptype ) ,
381- det4 : wp .array ( dtype = wptype ) ,
376+ v2 : wp .array [ mat22 ] ,
377+ v3 : wp .array [ mat33 ] ,
378+ v4 : wp .array [ mat44 ] ,
379+ det2 : wp .array [ wptype ] ,
380+ det3 : wp .array [ wptype ] ,
381+ det4 : wp .array [ wptype ] ,
382382 ):
383383 # multiply outputs by 2 so we've got something to backpropagate:
384384 det2 [0 ] = wptype (2 ) * wp .determinant (v2 [0 ])
@@ -511,8 +511,8 @@ def check_mat_det(
511511# output_select_kernel = get_select_kernel(kernel_cache, wptype)
512512#
513513# def check_mat_diag(
514- # m55: wp.array(dtype= mat55) ,
515- # outcomponents: wp.array(dtype= wptype) ,
514+ # m55: wp.array[ mat55] ,
515+ # outcomponents: wp.array[ wptype] ,
516516# ):
517517# # multiply outputs by 2 so we've got something to backpropagate:
518518# vec5result = wptype(2) * wp.get_diag(m55[0])
@@ -568,10 +568,10 @@ def test_inverse(test, device, dtype, register_kernels=False):
568568 output_select_kernel = get_select_kernel (kernel_cache , wptype )
569569
570570 def check_mat_inverse (
571- m2 : wp .array ( dtype = mat22 ) ,
572- m3 : wp .array ( dtype = mat33 ) ,
573- m4 : wp .array ( dtype = mat44 ) ,
574- outcomponents : wp .array ( dtype = wptype ) ,
571+ m2 : wp .array [ mat22 ] ,
572+ m3 : wp .array [ mat33 ] ,
573+ m4 : wp .array [ mat44 ] ,
574+ outcomponents : wp .array [ wptype ] ,
575575 ):
576576 m2result = wp .inverse (m2 [0 ])
577577 m3result = wp .inverse (m3 [0 ])
@@ -735,11 +735,11 @@ def test_svd(test, device, dtype, register_kernels=False):
735735 mat33 = wp .types .matrix (shape = (3 , 3 ), dtype = wptype )
736736
737737 def check_mat_svd (
738- m3 : wp .array ( dtype = mat33 ) ,
739- Uout : wp .array ( dtype = mat33 ) ,
740- sigmaout : wp .array ( dtype = vec3 ) ,
741- Vout : wp .array ( dtype = mat33 ) ,
742- outcomponents : wp .array ( dtype = wptype ) ,
738+ m3 : wp .array [ mat33 ] ,
739+ Uout : wp .array [ mat33 ] ,
740+ sigmaout : wp .array [ vec3 ] ,
741+ Vout : wp .array [ mat33 ] ,
742+ outcomponents : wp .array [ wptype ] ,
743743 ):
744744 U = mat33 ()
745745 sigma = vec3 ()
@@ -854,11 +854,11 @@ def test_svd_2D(test, device, dtype, register_kernels=False):
854854 mat22 = wp .types .matrix (shape = (2 , 2 ), dtype = wptype )
855855
856856 def check_mat_svd2 (
857- m2 : wp .array ( dtype = mat22 ) ,
858- Uout : wp .array ( dtype = mat22 ) ,
859- sigmaout : wp .array ( dtype = vec2 ) ,
860- Vout : wp .array ( dtype = mat22 ) ,
861- outcomponents : wp .array ( dtype = wptype ) ,
857+ m2 : wp .array [ mat22 ] ,
858+ Uout : wp .array [ mat22 ] ,
859+ sigmaout : wp .array [ vec2 ] ,
860+ Vout : wp .array [ mat22 ] ,
861+ outcomponents : wp .array [ wptype ] ,
862862 ):
863863 tid = wp .tid ()
864864
@@ -1001,10 +1001,10 @@ def test_qr(test, device, dtype, register_kernels=False):
10011001 mat33 = wp .types .matrix (shape = (3 , 3 ), dtype = wptype )
10021002
10031003 def check_mat_qr (
1004- m3 : wp .array ( dtype = mat33 ) ,
1005- Qout : wp .array ( dtype = mat33 ) ,
1006- Rout : wp .array ( dtype = mat33 ) ,
1007- outcomponents : wp .array ( dtype = wptype ) ,
1004+ m3 : wp .array [ mat33 ] ,
1005+ Qout : wp .array [ mat33 ] ,
1006+ Rout : wp .array [ mat33 ] ,
1007+ outcomponents : wp .array [ wptype ] ,
10081008 ):
10091009 Q = mat33 ()
10101010 R = mat33 ()
@@ -1114,10 +1114,10 @@ def test_eig(test, device, dtype, register_kernels=False):
11141114 mat33 = wp .types .matrix (shape = (3 , 3 ), dtype = wptype )
11151115
11161116 def check_mat_eig (
1117- m3 : wp .array ( dtype = mat33 ) ,
1118- Qout : wp .array ( dtype = mat33 ) ,
1119- dout : wp .array ( dtype = vec3 ) ,
1120- outcomponents : wp .array ( dtype = wptype ) ,
1117+ m3 : wp .array [ mat33 ] ,
1118+ Qout : wp .array [ mat33 ] ,
1119+ dout : wp .array [ vec3 ] ,
1120+ outcomponents : wp .array [ wptype ] ,
11211121 ):
11221122 Q = mat33 ()
11231123 d = vec3 ()
@@ -1227,8 +1227,8 @@ def test_skew(test, device, dtype, register_kernels=False):
12271227 output_select_kernel = get_select_kernel (kernel_cache , wptype )
12281228
12291229 def check_mat_skew (
1230- v3 : wp .array ( dtype = vec3 ) ,
1231- outcomponents : wp .array ( dtype = wptype ) ,
1230+ v3 : wp .array [ vec3 ] ,
1231+ outcomponents : wp .array [ wptype ] ,
12321232 ):
12331233 m3result = wp .skew (v3 [0 ])
12341234
@@ -1329,9 +1329,9 @@ def test_transform_point(test, device, dtype, register_kernels=False):
13291329 output_select_kernel = get_select_kernel (kernel_cache , wptype )
13301330
13311331 def check_mat_transform_point (
1332- v3 : wp .array ( dtype = vec3 ) ,
1333- m4 : wp .array ( dtype = mat44 ) ,
1334- outcomponents : wp .array ( dtype = wptype ) ,
1332+ v3 : wp .array [ vec3 ] ,
1333+ m4 : wp .array [ mat44 ] ,
1334+ outcomponents : wp .array [ wptype ] ,
13351335 ):
13361336 # multiply outputs by 2 so we've got something to backpropagate:
13371337 presult = wptype (2 ) * wp .transform_point (m4 [0 ], v3 [0 ])
@@ -1390,9 +1390,9 @@ def test_transform_vector(test, device, dtype, register_kernels=False):
13901390 output_select_kernel = get_select_kernel (kernel_cache , wptype )
13911391
13921392 def check_mat_transform_vector (
1393- v3 : wp .array ( dtype = vec3 ) ,
1394- m4 : wp .array ( dtype = mat44 ) ,
1395- outcomponents : wp .array ( dtype = wptype ) ,
1393+ v3 : wp .array [ vec3 ] ,
1394+ m4 : wp .array [ mat44 ] ,
1395+ outcomponents : wp .array [ wptype ] ,
13961396 ):
13971397 # multiply outputs by 2 so we've got something to backpropagate:
13981398 presult = wptype (2 ) * wp .transform_vector (m4 [0 ], v3 [0 ])
@@ -1459,7 +1459,7 @@ def matrix_len_kernel(
14591459 m2 : wp .types .matrix ((3 , 3 ), float ),
14601460 m3 : wp .types .matrix ((Any , Any ), float ),
14611461 m4 : Mat23 ,
1462- out : wp .array ( dtype = int ) ,
1462+ out : wp .array [ int ] ,
14631463):
14641464 length = wp .static (len (m1 ))
14651465 wp .expect_eq (len (m1 ), 2 )
@@ -1504,7 +1504,7 @@ def test_matrix_len(test, device):
15041504
15051505
15061506@wp .kernel
1507- def mat_extract_element (x : wp .array ( dtype = wp .mat22 ) , y : wp .array ( dtype = float ) ):
1507+ def mat_extract_element (x : wp .array [ wp .mat22 ] , y : wp .array [ float ] ):
15081508 tid = wp .tid ()
15091509
15101510 a = x [tid ]
@@ -1513,7 +1513,7 @@ def mat_extract_element(x: wp.array(dtype=wp.mat22), y: wp.array(dtype=float)):
15131513
15141514
15151515@wp .kernel
1516- def mat_extract_row (x : wp .array ( dtype = wp .mat22 ) , y : wp .array ( dtype = wp .vec2 ) ):
1516+ def mat_extract_row (x : wp .array [ wp .mat22 ] , y : wp .array [ wp .vec2 ] ):
15171517 tid = wp .tid ()
15181518
15191519 a = x [tid ]
@@ -1552,7 +1552,7 @@ def test_mat_extract(test, device):
15521552
15531553
15541554@wp .kernel
1555- def mat_assign_element (x : wp .array ( dtype = float ) , y : wp .array ( dtype = wp .mat22 ) ):
1555+ def mat_assign_element (x : wp .array [ float ] , y : wp .array [ wp .mat22 ] ):
15561556 i = wp .tid ()
15571557
15581558 a = wp .mat22 ()
@@ -1565,7 +1565,7 @@ def mat_assign_element(x: wp.array(dtype=float), y: wp.array(dtype=wp.mat22)):
15651565
15661566
15671567@wp .kernel
1568- def mat_assign_row (x : wp .array ( dtype = wp .vec2 ) , y : wp .array ( dtype = wp .mat22 ) ):
1568+ def mat_assign_row (x : wp .array [ wp .vec2 ] , y : wp .array [ wp .mat22 ] ):
15691569 i = wp .tid ()
15701570
15711571 a = wp .mat22 ()
@@ -1606,7 +1606,7 @@ def test_mat_assign(test, device):
16061606
16071607
16081608@wp .kernel
1609- def mat_array_extract_element (x : wp .array2d ( dtype = wp .mat22 ) , y : wp .array2d ( dtype = float ) ):
1609+ def mat_array_extract_element (x : wp .array2d [ wp .mat22 ] , y : wp .array2d [ float ] ):
16101610 i , j = wp .tid ()
16111611 a = x [i , j ][0 , 0 ]
16121612 b = x [i , j ][0 , 1 ]
@@ -1616,7 +1616,7 @@ def mat_array_extract_element(x: wp.array2d(dtype=wp.mat22), y: wp.array2d(dtype
16161616
16171617
16181618@wp .kernel
1619- def mat_array_extract_row (x : wp .array2d ( dtype = wp .mat22 ) , y : wp .array2d ( dtype = wp .vec2 ) ):
1619+ def mat_array_extract_row (x : wp .array2d [ wp .mat22 ] , y : wp .array2d [ wp .vec2 ] ):
16201620 i , j = wp .tid ()
16211621 a = x [i , j ][0 ]
16221622 b = x [i , j ][1 ]
@@ -1654,7 +1654,7 @@ def test_mat_array_extract(test, device):
16541654
16551655
16561656@wp .kernel
1657- def mat_array_assign_element (x : wp .array2d ( dtype = float ) , y : wp .array2d ( dtype = wp .mat22 ) ):
1657+ def mat_array_assign_element (x : wp .array2d [ float ] , y : wp .array2d [ wp .mat22 ] ):
16581658 i , j = wp .tid ()
16591659
16601660 y [i , j ][0 , 0 ] = 1.0 * x [i , j ]
@@ -1666,7 +1666,7 @@ def mat_array_assign_element(x: wp.array2d(dtype=float), y: wp.array2d(dtype=wp.
16661666# TODO: mat row/slice writes (y[i,j][0] = vec) fall back to the legacy
16671667# path and do not yet propagate gradients correctly.
16681668# @wp.kernel
1669- # def mat_array_assign_row(x: wp.array2d(dtype= wp.vec3) , y: wp.array2d(dtype= wp.types.matrix(shape=(2, 3), dtype=float)) ):
1669+ # def mat_array_assign_row(x: wp.array2d[ wp.vec3] , y: wp.array2d[ wp.types.matrix(shape=(2, 3), dtype=float)] ):
16701670# i, j = wp.tid()
16711671#
16721672# y[i, j][0] = 1.0 * x[i, j]
@@ -1690,7 +1690,7 @@ def test_mat_array_assign(test, device):
16901690
16911691
16921692@wp .kernel
1693- def mat_add_inplace_element (x : wp .array ( dtype = wp .mat22 ) , y : wp .array ( dtype = wp .mat22 ) ):
1693+ def mat_add_inplace_element (x : wp .array [ wp .mat22 ] , y : wp .array [ wp .mat22 ] ):
16941694 i = wp .tid ()
16951695
16961696 a = wp .mat22 ()
@@ -1705,7 +1705,7 @@ def mat_add_inplace_element(x: wp.array(dtype=wp.mat22), y: wp.array(dtype=wp.ma
17051705
17061706
17071707@wp .kernel
1708- def mat_add_inplace_row (x : wp .array ( dtype = wp .mat22 ) , y : wp .array ( dtype = wp .mat22 ) ):
1708+ def mat_add_inplace_row (x : wp .array [ wp .mat22 ] , y : wp .array [ wp .mat22 ] ):
17091709 i = wp .tid ()
17101710
17111711 a = wp .mat22 ()
@@ -1746,7 +1746,7 @@ def test_mat_add_inplace(test, device):
17461746
17471747
17481748@wp .kernel
1749- def mat_sub_inplace_element (x : wp .array ( dtype = wp .mat22 ) , y : wp .array ( dtype = wp .mat22 ) ):
1749+ def mat_sub_inplace_element (x : wp .array [ wp .mat22 ] , y : wp .array [ wp .mat22 ] ):
17501750 i = wp .tid ()
17511751
17521752 a = wp .mat22 ()
@@ -1761,7 +1761,7 @@ def mat_sub_inplace_element(x: wp.array(dtype=wp.mat22), y: wp.array(dtype=wp.ma
17611761
17621762
17631763@wp .kernel
1764- def mat_sub_inplace_row (x : wp .array ( dtype = wp .mat22 ) , y : wp .array ( dtype = wp .mat22 ) ):
1764+ def mat_sub_inplace_row (x : wp .array [ wp .mat22 ] , y : wp .array [ wp .mat22 ] ):
17651765 i = wp .tid ()
17661766
17671767 a = wp .mat22 ()
@@ -1802,7 +1802,7 @@ def test_mat_sub_inplace(test, device):
18021802
18031803
18041804@wp .kernel
1805- def mat_array_add_inplace (x : wp .array ( dtype = wp .mat22 ) , y : wp .array ( dtype = wp .mat22 ) ):
1805+ def mat_array_add_inplace (x : wp .array [ wp .mat22 ] , y : wp .array [ wp .mat22 ] ):
18061806 i = wp .tid ()
18071807
18081808 y [i ] += x [i ]
@@ -1824,7 +1824,7 @@ def test_mat_array_add_inplace(test, device):
18241824
18251825
18261826@wp .kernel
1827- def mat_array_sub_inplace (x : wp .array ( dtype = wp .mat22 ) , y : wp .array ( dtype = wp .mat22 ) ):
1827+ def mat_array_sub_inplace (x : wp .array [ wp .mat22 ] , y : wp .array [ wp .mat22 ] ):
18281828 i = wp .tid ()
18291829
18301830 y [i ] -= x [i ]
@@ -1846,7 +1846,7 @@ def test_mat_array_sub_inplace(test, device):
18461846
18471847
18481848@wp .kernel
1849- def scalar_mat_div (x : wp .array ( dtype = wp .mat22 ) , y : wp .array ( dtype = wp .mat22 ) ):
1849+ def scalar_mat_div (x : wp .array [ wp .mat22 ] , y : wp .array [ wp .mat22 ] ):
18501850 i = wp .tid ()
18511851 y [i ] = 1.0 / x [i ]
18521852
@@ -3327,9 +3327,9 @@ def test_mat_slicing_assign_backward(test, device):
33273327
33283328 @wp .kernel (module = "unique" )
33293329 def kernel (
3330- arr_x : wp .array ( dtype = wp .vec2 ) ,
3331- arr_y : wp .array ( dtype = mat23 ) ,
3332- arr_z : wp .array ( dtype = wp .mat44 ) ,
3330+ arr_x : wp .array [ wp .vec2 ] ,
3331+ arr_y : wp .array [ mat23 ] ,
3332+ arr_z : wp .array [ wp .mat44 ] ,
33333333 ):
33343334 i = wp .tid ()
33353335
0 commit comments