File tree Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -571,6 +571,20 @@ def type(self):
571571 """
572572 return self .dtype ().value
573573
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+
574588 def dims (self ):
575589 """
576590 Return the shape of the array as a tuple.
@@ -584,6 +598,13 @@ def dims(self):
584598 dims = (d0 .value ,d1 .value ,d2 .value ,d3 .value )
585599 return dims [:self .numdims ()]
586600
601+ @property
602+ def shape (self ):
603+ """
604+ The shape of the array
605+ """
606+ return self .dims ()
607+
587608 def numdims (self ):
588609 """
589610 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):
1818
1919 a = af .Array ([1 , 2 , 3 ])
2020 display_func (a )
21+ display_func (a .T )
22+ display_func (a .H )
23+ print_func (a .shape )
2124
2225 b = a .as_type (af .Dtype .s32 )
2326 display_func (b )
You can’t perform that action at this time.
0 commit comments