@@ -3848,13 +3848,14 @@ def transpose(a, axes=None):
3848
3848
----------
3849
3849
a : {dpnp.ndarray, usm_ndarray}
3850
3850
Input array.
3851
- axes : None, tuple or list of ints, optional
3851
+ axes : { None, tuple or list of ints} , optional
3852
3852
If specified, it must be a tuple or list which contains a permutation
3853
3853
of [0, 1, ..., N-1] where N is the number of axes of `a`.
3854
3854
The `i`'th axis of the returned array will correspond to the axis
3855
3855
numbered ``axes[i]`` of the input. If not specified or ``None``,
3856
3856
defaults to ``range(a.ndim)[::-1]``, which reverses the order of
3857
3857
the axes.
3858
+ Default: ``None``.
3858
3859
3859
3860
Returns
3860
3861
-------
@@ -3894,18 +3895,13 @@ def transpose(a, axes=None):
3894
3895
3895
3896
"""
3896
3897
3897
- if isinstance (a , dpnp_array ):
3898
- array = a
3899
- elif isinstance (a , dpt .usm_ndarray ):
3900
- array = dpnp_array ._create_from_usm_ndarray (a )
3901
- else :
3902
- raise TypeError (
3903
- f"An array must be any of supported type, but got { type (a )} "
3904
- )
3898
+ dpnp .check_supported_arrays_type (a )
3899
+ if isinstance (a , dpt .usm_ndarray ):
3900
+ a = dpnp_array ._create_from_usm_ndarray (a )
3905
3901
3906
3902
if axes is None :
3907
- return array .transpose ()
3908
- return array .transpose (* axes )
3903
+ return a .transpose ()
3904
+ return a .transpose (* axes )
3909
3905
3910
3906
3911
3907
permute_dims = transpose # permute_dims is an alias for transpose
0 commit comments