@@ -95,7 +95,7 @@ def permute_dims(X, /, axes):
95
95
`(0,1,...,N-1)` where `N` is the number of axes (dimensions)
96
96
of `x`.
97
97
Returns:
98
- usm_narray :
98
+ usm_ndarray :
99
99
An array with permuted axes.
100
100
The returned array must has the same data type as `x`,
101
101
is created on the same device as `x` and has the same USM allocation
@@ -646,7 +646,7 @@ def moveaxis(X, source, destination, /):
646
646
in the half-open interval `[-N, N)`.
647
647
648
648
Returns:
649
- usm_narray :
649
+ usm_ndarray :
650
650
Array with moved axes.
651
651
The returned array must has the same data type as `x`,
652
652
is created on the same device as `x` and has the same
@@ -693,7 +693,7 @@ def swapaxes(X, axis1, axis2):
693
693
a valid `axis` must be in the half-open interval `[-N, N)`.
694
694
695
695
Returns:
696
- usm_narray :
696
+ usm_ndarray :
697
697
Array with swapped axes.
698
698
The returned array must has the same data type as `x`,
699
699
is created on the same device as `x` and has the same USM
@@ -717,32 +717,38 @@ def swapaxes(X, axis1, axis2):
717
717
def repeat (x , repeats , / , * , axis = None ):
718
718
"""repeat(x, repeats, axis=None)
719
719
720
- Repeat elements of an array.
720
+ Repeat elements of an array on a per-element basis .
721
721
722
722
Args:
723
723
x (usm_ndarray): input array
724
724
725
725
repeats (Union[int, Sequence[int, ...], usm_ndarray]):
726
726
The number of repetitions for each element.
727
- `repeats` is broadcast to fit the shape of the given axis.
727
+
728
+ `repeats` must be broadcast-compatible with `N` where `N` is
729
+ `prod(x.shape)` if `axis` is `None` and `x.shape[axis]`
730
+ otherwise.
731
+
728
732
If `repeats` is an array, it must have an integer data type.
729
- Otherwise, `repeats` must be a Python integer, tuple, list, or
730
- range.
733
+ Otherwise, `repeats` must be a Python integer or sequence of
734
+ Python integers (i.e., a tuple, list, or range) .
731
735
732
736
axis (Optional[int]):
733
737
The axis along which to repeat values. If `axis` is `None`, the
734
- function repeats elements of the flattened array.
735
- Default: `None`.
738
+ function repeats elements of the flattened array. Default: `None`.
736
739
737
740
Returns:
738
- usm_narray:
739
- Array with repeated elements.
740
- The returned array must have the same data type as `x`, is created
741
- on the same device as `x` and has the same USM allocation type as
742
- `x`. If `axis` is `None`, the returned array is one-dimensional,
741
+ usm_ndarray:
742
+ output array with repeated elements.
743
+
744
+ If `axis` is `None`, the returned array is one-dimensional,
743
745
otherwise, it has the same shape as `x`, except for the axis along
744
746
which elements were repeated.
745
747
748
+ The returned array will have the same data type as `x`.
749
+ The returned array will be located on the same device as `x` and
750
+ have the same USM allocation type as `x`.
751
+
746
752
Raises:
747
753
AxisError: if `axis` value is invalid.
748
754
"""
@@ -937,21 +943,28 @@ def tile(x, repetitions, /):
937
943
`repetitions`.
938
944
939
945
For `N` = len(`repetitions`) and `M` = len(`x.shape`):
940
- - if `M < N`, `x` will have `N - M` new axes prepended to its shape
941
- - if `M > N`, `repetitions` will have `M - N` new axes 1 prepended to it
946
+
947
+ * If `M < N`, `x` will have `N - M` new axes prepended to its shape
948
+ * If `M > N`, `repetitions` will have `M - N` ones prepended to it
942
949
943
950
Args:
944
951
x (usm_ndarray): input array
945
952
946
953
repetitions (Union[int, Tuple[int, ...]]):
947
- The number of repetitions for each dimension.
954
+ The number of repetitions along each dimension of `x` .
948
955
949
956
Returns:
950
- usm_narray:
951
- Array with tiled elements.
952
- The returned array must have the same data type as `x`,
953
- is created on the same device as `x` and has the same USM
954
- allocation type as `x`.
957
+ usm_ndarray:
958
+ tiled output array.
959
+
960
+ The returned array will have rank `max(M, N)`. If `S` is the
961
+ shape of `x` after prepending dimensions and `R` is
962
+ `repetitions` after prepending ones, then the shape of the
963
+ result will be `S[i] * R[i]` for each dimension `i`.
964
+
965
+ The returned array will have the same data type as `x`.
966
+ The returned array will be located on the same device as `x` and
967
+ have the same USM allocation type as `x`.
955
968
"""
956
969
if not isinstance (x , dpt .usm_ndarray ):
957
970
raise TypeError (f"Expected usm_ndarray type, got { type (x )} ." )
0 commit comments