@@ -355,7 +355,6 @@ using OffsetArrays
355
355
@test @inferred (dense_dims (@view (PermutedDimsArray (A,(3 ,1 ,2 ))[2 : 3 ,:,[1 ,2 ]]))) === ArrayInterface. DenseDims ((false ,true ,false ))
356
356
@test @inferred (dense_dims (@view (PermutedDimsArray (A,(3 ,1 ,2 ))[2 : 3 ,[1 ,2 ,3 ],:]))) === ArrayInterface. DenseDims ((false ,false ,false ))
357
357
358
-
359
358
B = Array {Int8} (undef, 2 ,2 ,2 ,2 );
360
359
doubleperm = PermutedDimsArray (PermutedDimsArray (B,(4 ,2 ,3 ,1 )), (4 ,2 ,1 ,3 ));
361
360
@test collect (strides (B))[collect (stride_rank (doubleperm))] == collect (strides (doubleperm))
@@ -368,11 +367,18 @@ end
368
367
Sp2 = @view (PermutedDimsArray (S,(3 ,2 ,1 ))[2 : 3 ,:,:]);
369
368
Mp2 = @view (PermutedDimsArray (M,(3 ,1 ,2 ))[2 : 3 ,:,2 ])' ;
370
369
D = @view (A[:,2 : 2 : 4 ,:])
370
+ R = StaticInt (1 ): StaticInt (2 )
371
+ Rr = reinterpret (Int32, R)
372
+ Ar = reinterpret (Float32, A)
371
373
374
+
372
375
@test @inferred (ArrayInterface. size (A)) === (3 ,4 ,5 )
373
376
@test @inferred (ArrayInterface. size (Ap)) === (2 ,5 )
374
377
@test @inferred (ArrayInterface. size (A)) === size (A)
375
378
@test @inferred (ArrayInterface. size (Ap)) === size (Ap)
379
+ @test @inferred (ArrayInterface. size (R)) === (StaticInt (2 ),)
380
+ @test @inferred (ArrayInterface. size (Rr)) === (StaticInt (4 ),)
381
+
376
382
377
383
@test @inferred (ArrayInterface. size (S)) === (StaticInt (2 ), StaticInt (3 ), StaticInt (4 ))
378
384
@test @inferred (ArrayInterface. size (Sp)) === (2 , 2 , StaticInt (3 ))
394
400
395
401
@test @inferred (ArrayInterface. known_size (A)) === (nothing , nothing , nothing )
396
402
@test @inferred (ArrayInterface. known_size (Ap)) === (nothing ,nothing )
403
+ @test @inferred (ArrayInterface. known_size (R)) === (2 ,)
404
+ @test @inferred (ArrayInterface. known_size (Rr)) === (4 ,)
405
+ @test @inferred (ArrayInterface. known_size (Ar)) === (nothing ,nothing , nothing ,)
397
406
398
407
@test @inferred (ArrayInterface. known_size (S)) === (2 , 3 , 4 )
399
408
@test @inferred (ArrayInterface. known_size (Sp)) === (nothing , nothing , 3 )
410
419
@test @inferred (ArrayInterface. strides (Ap)) === (StaticInt (1 ), 12 )
411
420
@test @inferred (ArrayInterface. strides (A)) == strides (A)
412
421
@test @inferred (ArrayInterface. strides (Ap)) == strides (Ap)
422
+ @test @inferred (ArrayInterface. strides (Ar)) === (StaticInt {1} (), 6 , 24 )
423
+
413
424
414
425
@test @inferred (ArrayInterface. strides (S)) === (StaticInt (1 ), StaticInt (2 ), StaticInt (6 ))
415
426
@test @inferred (ArrayInterface. strides (Sp)) === (StaticInt (6 ), StaticInt (1 ), StaticInt (2 ))
427
438
428
439
@test @inferred (ArrayInterface. known_strides (A)) === (1 , nothing , nothing )
429
440
@test @inferred (ArrayInterface. known_strides (Ap)) === (1 , nothing )
430
-
441
+ @test @inferred (ArrayInterface. known_strides (Ar)) === (1 , nothing , nothing )
442
+
431
443
@test @inferred (ArrayInterface. known_strides (S)) === (1 , 2 , 6 )
432
444
@test @inferred (ArrayInterface. known_strides (Sp)) === (6 , 1 , 2 )
433
445
@test @inferred (ArrayInterface. known_strides (Sp2)) === (6 , 2 , 1 )
441
453
442
454
@test @inferred (ArrayInterface. offsets (A)) === (StaticInt (1 ), StaticInt (1 ), StaticInt (1 ))
443
455
@test @inferred (ArrayInterface. offsets (Ap)) === (StaticInt (1 ), StaticInt (1 ))
456
+ @test @inferred (ArrayInterface. offsets (Ar)) === (StaticInt (1 ), StaticInt (1 ), StaticInt (1 ))
444
457
445
458
@test @inferred (ArrayInterface. offsets (S)) === (StaticInt (1 ), StaticInt (1 ), StaticInt (1 ))
446
459
@test @inferred (ArrayInterface. offsets (Sp)) === (StaticInt (1 ), StaticInt (1 ), StaticInt (1 ))
452
465
453
466
@test @inferred (ArrayInterface. known_offsets (A)) === (1 , 1 , 1 )
454
467
@test @inferred (ArrayInterface. known_offsets (Ap)) === (1 , 1 )
468
+ @test @inferred (ArrayInterface. known_offsets (Ar)) === (1 , 1 , 1 )
455
469
456
470
@test @inferred (ArrayInterface. known_offsets (S)) === (1 , 1 , 1 )
457
471
@test @inferred (ArrayInterface. known_offsets (Sp)) === (1 , 1 , 1 )
461
475
@test @inferred (ArrayInterface. known_offsets (Mp)) === (1 , 1 )
462
476
@test @inferred (ArrayInterface. known_offsets (Mp2)) === (1 , 1 )
463
477
478
+ @test @inferred (ArrayInterface. known_offsets (R)) === (1 ,)
479
+ @test @inferred (ArrayInterface. known_offsets (Rr)) === (1 ,)
480
+ @test @inferred (ArrayInterface. known_offsets (1 : 10 )) === (1 ,)
481
+
464
482
O = OffsetArray (A, 3 , 7 , 10 );
465
483
Op = PermutedDimsArray (O,(3 ,1 ,2 ));
466
484
@test @inferred (ArrayInterface. offsets (O)) === (4 , 8 , 11 )
0 commit comments