File tree 2 files changed +24
-0
lines changed
2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -571,6 +571,20 @@ def type(self):
571
571
"""
572
572
return self .dtype ().value
573
573
574
+ @property
575
+ def T (self ):
576
+ """
577
+ Return the transpose of the array
578
+ """
579
+ return transpose (self , False )
580
+
581
+ @property
582
+ def H (self ):
583
+ """
584
+ Return the hermitian transpose of the array
585
+ """
586
+ return transpose (self , False )
587
+
574
588
def dims (self ):
575
589
"""
576
590
Return the shape of the array as a tuple.
@@ -584,6 +598,13 @@ def dims(self):
584
598
dims = (d0 .value ,d1 .value ,d2 .value ,d3 .value )
585
599
return dims [:self .numdims ()]
586
600
601
+ @property
602
+ def shape (self ):
603
+ """
604
+ The shape of the array
605
+ """
606
+ return self .dims ()
607
+
587
608
def numdims (self ):
588
609
"""
589
610
Return the number of dimensions of the array.
Original file line number Diff line number Diff line change @@ -18,6 +18,9 @@ def simple_array(verbose=False):
18
18
19
19
a = af .Array ([1 , 2 , 3 ])
20
20
display_func (a )
21
+ display_func (a .T )
22
+ display_func (a .H )
23
+ print_func (a .shape )
21
24
22
25
b = a .as_type (af .Dtype .s32 )
23
26
display_func (b )
You can’t perform that action at this time.
0 commit comments