3232
3333def _get_unwrapped_index_key (key ):
3434 """
35+ Get an unwrapped index key.
36+
3537 Return a key where each nested instance of DPNP array is unwrapped into USM ndarray
3638 for futher processing in DPCTL advanced indexing functions.
3739
@@ -109,9 +111,7 @@ def T(self):
109111 return self .transpose ()
110112
111113 def to_device (self , target_device ):
112- """
113- Transfer array to target device
114- """
114+ """Transfer array to target device."""
115115
116116 return dpnp_array (
117117 shape = self .shape , buffer = self .get_array ().to_device (target_device )
@@ -276,9 +276,7 @@ def __le__(self, other):
276276 return dpnp .less_equal (self , other )
277277
278278 def __len__ (self ):
279- """
280- Performs the operation __len__.
281- """
279+ """Performs the operation __len__."""
282280
283281 return self ._array_obj .__len__ ()
284282
@@ -335,7 +333,7 @@ def __rmatmul__(self, other):
335333 return dpnp .matmul (other , self )
336334
337335 def __rmod__ (self , other ):
338- return remainder (other , self )
336+ return dpnp . remainder (other , self )
339337
340338 def __rmul__ (self , other ):
341339 return dpnp .multiply (other , self )
@@ -499,8 +497,7 @@ def argmin(self, axis=None, out=None):
499497
500498 def argsort (self , axis = - 1 , kind = None , order = None ):
501499 """
502- Return an ndarray of indices that sort the array along the
503- specified axis.
500+ Return an ndarray of indices that sort the array along the specified axis.
504501
505502 Parameters
506503 ----------
@@ -584,10 +581,7 @@ def astype(self, dtype, order="K", casting="unsafe", subok=True, copy=True):
584581 # 'byteswap',
585582
586583 def choose (input , choices , out = None , mode = "raise" ):
587- """
588- Construct an array from an index array and a set of arrays to choose from.
589-
590- """
584+ """Construct an array from an index array and a set of arrays to choose from."""
591585
592586 return dpnp .choose (input , choices , out , mode )
593587
@@ -655,7 +649,7 @@ def dot(self, other, out=None):
655649
656650 @property
657651 def dtype (self ):
658- """ """
652+ """Returns NumPy's dtype corresponding to the type of the array elements. """
659653
660654 return self ._array_obj .dtype
661655
@@ -689,19 +683,13 @@ def fill(self, value):
689683
690684 @property
691685 def flags (self ):
692- """
693- Return information about the memory layout of the array.
694-
695- """
686+ """Return information about the memory layout of the array."""
696687
697688 return self ._array_obj .flags
698689
699690 @property
700691 def flat (self ):
701- """
702- Return a flat iterator, or set a flattened version of self to value.
703-
704- """
692+ """Return a flat iterator, or set a flattened version of self to value."""
705693
706694 return dpnp .flatiter (self )
707695
@@ -787,10 +775,7 @@ def item(self, id=None):
787775
788776 @property
789777 def itemsize (self ):
790- """
791- Size of one array element in bytes.
792-
793- """
778+ """Size of one array element in bytes."""
794779
795780 return self ._array_obj .itemsize
796781
@@ -802,16 +787,12 @@ def max(
802787 initial = numpy ._NoValue ,
803788 where = numpy ._NoValue ,
804789 ):
805- """
806- Return the maximum along an axis.
807- """
790+ """Return the maximum along an axis."""
808791
809792 return dpnp .max (self , axis , out , keepdims , initial , where )
810793
811794 def mean (self , axis = None , ** kwargs ):
812- """
813- Returns the average of the array elements.
814- """
795+ """Returns the average of the array elements."""
815796
816797 return dpnp .mean (self , axis = axis , ** kwargs )
817798
@@ -823,27 +804,19 @@ def min(
823804 initial = numpy ._NoValue ,
824805 where = numpy ._NoValue ,
825806 ):
826- """
827- Return the minimum along a given axis.
828- """
807+ """Return the minimum along a given axis."""
829808
830809 return dpnp .min (self , axis , out , keepdims , initial , where )
831810
832811 @property
833812 def nbytes (self ):
834- """
835- Total bytes consumed by the elements of the array.
836-
837- """
813+ """Total bytes consumed by the elements of the array."""
838814
839815 return self ._array_obj .nbytes
840816
841817 @property
842818 def ndim (self ):
843- """
844- Number of array dimensions.
845-
846- """
819+ """Number of array dimensions."""
847820
848821 return self ._array_obj .ndim
849822
@@ -854,6 +827,8 @@ def nonzero(self):
854827
855828 def partition (self , kth , axis = - 1 , kind = "introselect" , order = None ):
856829 """
830+ Return a partitioned copy of an array.
831+
857832 Rearranges the elements in the array in such a way that the value of the
858833 element in kth position is in the position it would be in a sorted array.
859834
@@ -968,7 +943,10 @@ def shape(self):
968943
969944 @shape .setter
970945 def shape (self , newshape ):
971- """Set new lengths of axes. A tuple of numbers represents size of each dimention.
946+ """
947+ Set new lengths of axes.
948+
949+ A tuple of numbers represents size of each dimention.
972950 It involves reshaping without copy. If the array cannot be reshaped without copy,
973951 it raises an exception.
974952
@@ -980,7 +958,7 @@ def shape(self, newshape):
980958
981959 @property
982960 def size (self ):
983- """ """
961+ """Number of elements in the array. """
984962
985963 return self ._array_obj .size
986964
@@ -1009,7 +987,17 @@ def std(self, axis=None, dtype=None, out=None, ddof=0, keepdims=False):
1009987
1010988 @property
1011989 def strides (self ):
1012- """ """
990+ """
991+ Get strides of an array.
992+
993+ Returns memory displacement in array elements, upon unit
994+ change of respective index.
995+
996+ E.g. for strides (s1, s2, s3) and multi-index (i1, i2, i3)
997+
998+ a[i1, i2, i3] == (&a[0,0,0])[ s1*s1 + s2*i2 + s3*i3]
999+
1000+ """
10131001
10141002 return self ._array_obj .strides
10151003
0 commit comments