14
14
</ script >
15
15
16
16
< meta name ="viewport " content ="width=device-width, initial-scale=1.0 " />
17
- < title > dpnp.dpnp_array — Data Parallel Extension for NumPy 0.17.0dev6+29.g62ae40bcc36 documentation</ title >
17
+ < title > dpnp.dpnp_array — Data Parallel Extension for NumPy 0.18.0dev0+31.g2c6c6973651 documentation</ title >
18
18
< link rel ="stylesheet " type ="text/css " href ="../../_static/pygments.css?v=03e43079 " />
19
19
< link rel ="stylesheet " type ="text/css " href ="../../_static/css/theme.css?v=e59714d7 " />
20
20
21
21
22
22
< script src ="../../_static/jquery.js?v=5d32c60e "> </ script >
23
23
< script src ="../../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c "> </ script >
24
- < script src ="../../_static/documentation_options.js?v=a964444e "> </ script >
24
+ < script src ="../../_static/documentation_options.js?v=5356ff8b "> </ script >
25
25
< script src ="../../_static/doctools.js?v=9bcbadda "> </ script >
26
26
< script src ="../../_static/sphinx_highlight.js?v=dc90522c "> </ script >
27
27
< script src ="../../_static/js/theme.js "> </ script >
@@ -899,47 +899,51 @@ <h1>Source code for dpnp.dpnp_array</h1><div class="highlight"><pre>
899
899
900
900
< span class ="sd "> Parameters</ span >
901
901
< span class ="sd "> ----------</ span >
902
- < span class ="sd "> x1 : {dpnp.ndarray, usm_ndarray}</ span >
903
- < span class ="sd "> Array data type casting.</ span >
904
902
< span class ="sd "> dtype : {None, str, dtype object}</ span >
905
903
< span class ="sd "> Target data type.</ span >
906
- < span class ="sd "> order : {"C", "F", "A", "K"}, optional</ span >
904
+ < span class ="sd "> order : {None, "C", "F", "A", "K"}, optional</ span >
907
905
< span class ="sd "> Row-major (C-style) or column-major (Fortran-style) order.</ span >
908
- < span class ="sd "> When ``order`` is 'A', it uses 'F' if ``a`` is column-major and uses 'C' otherwise.</ span >
909
- < span class ="sd "> And when ``order`` is 'K', it keeps strides as closely as possible.</ span >
910
- < span class ="sd "> copy : bool</ span >
911
- < span class ="sd "> If it is False and no cast happens, then this method returns the array itself.</ span >
912
- < span class ="sd "> Otherwise, a copy is returned.</ span >
913
- < span class ="sd "> casting : {'no', 'equiv', 'safe', 'same_kind', 'unsafe'}, optional</ span >
914
- < span class ="sd "> Controls what kind of data casting may occur.</ span >
915
- < span class ="sd "> Defaults to ``'unsafe'`` for backwards compatibility.</ span >
916
-
917
- < span class ="sd "> - 'no' means the data types should not be cast at all.</ span >
918
- < span class ="sd "> - 'equiv' means only byte-order changes are allowed.</ span >
919
- < span class ="sd "> - 'safe' means only casts which can preserve values are allowed.</ span >
920
- < span class ="sd "> - 'same_kind' means only safe casts or casts within a kind, like</ span >
921
- < span class ="sd "> float64 to float32, are allowed.</ span >
922
- < span class ="sd "> - 'unsafe' means any data conversions may be done.</ span >
923
-
924
- < span class ="sd "> copy : {bool}, optional</ span >
925
- < span class ="sd "> By default, ``astype`` always returns a newly allocated array. If</ span >
926
- < span class ="sd "> this is set to ``False``, and the `dtype`, `order`, and `subok`</ span >
927
- < span class ="sd "> requirements are satisfied, the input array is returned instead of</ span >
928
- < span class ="sd "> a copy.</ span >
929
- < span class ="sd "> device : {None, string, SyclDevice, SyclQueue}, optional</ span >
906
+ < span class ="sd "> When `order` is ``"A"``, it uses ``"F"`` if `a` is column-major and</ span >
907
+ < span class ="sd "> uses ``"C"`` otherwise. And when `order` is ``"K"``, it keeps</ span >
908
+ < span class ="sd "> strides as closely as possible.</ span >
909
+
910
+ < span class ="sd "> Default: ``"K"``.</ span >
911
+ < span class ="sd "> casting : {"no", "equiv", "safe", "same_kind", "unsafe"}, optional</ span >
912
+ < span class ="sd "> Controls what kind of data casting may occur. Defaults to</ span >
913
+ < span class ="sd "> ``"unsafe"`` for backwards compatibility.</ span >
914
+
915
+ < span class ="sd "> - "no" means the data types should not be cast at all.</ span >
916
+ < span class ="sd "> - "equiv" means only byte-order changes are allowed.</ span >
917
+ < span class ="sd "> - "safe" means only casts which can preserve values are allowed.</ span >
918
+ < span class ="sd "> - "same_kind" means only safe casts or casts within a kind,</ span >
919
+ < span class ="sd "> like float64 to float32, are allowed.</ span >
920
+ < span class ="sd "> - "unsafe" means any data conversions may be done.</ span >
921
+
922
+ < span class ="sd "> Default: ``"unsafe"``.</ span >
923
+ < span class ="sd "> copy : bool, optional</ span >
924
+ < span class ="sd "> Specifies whether to copy an array when the specified dtype matches</ span >
925
+ < span class ="sd "> the data type of that array. If ``True``, a newly allocated array</ span >
926
+ < span class ="sd "> must always be returned. If ``False`` and the specified dtype</ span >
927
+ < span class ="sd "> matches the data type of that array, the self array must be returned;</ span >
928
+ < span class ="sd "> otherwise, a newly allocated array must be returned.</ span >
929
+
930
+ < span class ="sd "> Default: ``True``.</ span >
931
+ < span class ="sd "> device : {None, string, SyclDevice, SyclQueue, Device}, optional</ span >
930
932
< span class ="sd "> An array API concept of device where the output array is created.</ span >
931
- < span class ="sd "> The `device` can be ``None`` (the default), an OneAPI filter selector</ span >
932
- < span class ="sd "> string, an instance of :class:`dpctl.SyclDevice` corresponding to</ span >
933
- < span class ="sd "> a non-partitioned SYCL device, an instance of :class:`dpctl.SyclQueue`,</ span >
934
- < span class ="sd "> or a `Device` object returned by</ span >
935
- < span class ="sd "> :obj:`dpnp.dpnp_array.dpnp_array.device` property. Default: ``None``.</ span >
933
+ < span class ="sd "> `device` can be ``None``, a oneAPI filter selector string,</ span >
934
+ < span class ="sd "> an instance of :class:`dpctl.SyclDevice` corresponding to</ span >
935
+ < span class ="sd "> a non-partitioned SYCL device, an instance of</ span >
936
+ < span class ="sd "> :class:`dpctl.SyclQueue`, or a :class:`dpctl.tensor.Device` object</ span >
937
+ < span class ="sd "> returned by :attr:`dpnp.ndarray.device`.</ span >
938
+ < span class ="sd "> If the value is ``None``, returned array is created on the same</ span >
939
+ < span class ="sd "> device as that array.</ span >
940
+
941
+ < span class ="sd "> Default: ``None``.</ span >
936
942
937
943
< span class ="sd "> Returns</ span >
938
944
< span class ="sd "> -------</ span >
939
- < span class ="sd "> arr_t : dpnp.ndarray</ span >
940
- < span class ="sd "> Unless `copy` is ``False`` and the other conditions for returning the input array</ span >
941
- < span class ="sd "> are satisfied, `arr_t` is a new array of the same shape as the input array,</ span >
942
- < span class ="sd "> with dtype, order given by dtype, order.</ span >
945
+ < span class ="sd "> out : dpnp.ndarray</ span >
946
+ < span class ="sd "> An array having the specified data type.</ span >
943
947
944
948
< span class ="sd "> Limitations</ span >
945
949
< span class ="sd "> -----------</ span >
@@ -949,9 +953,9 @@ <h1>Source code for dpnp.dpnp_array</h1><div class="highlight"><pre>
949
953
< span class ="sd "> Examples</ span >
950
954
< span class ="sd "> --------</ span >
951
955
< span class ="sd "> >>> import dpnp as np</ span >
952
- < span class ="sd "> >>> x = np.array([1, 2, 2.5])</ span >
953
- < span class ="sd "> >>> x</ span >
956
+ < span class ="sd "> >>> x = np.array([1, 2, 2.5]); x</ span >
954
957
< span class ="sd "> array([1. , 2. , 2.5])</ span >
958
+
955
959
< span class ="sd "> >>> x.astype(int)</ span >
956
960
< span class ="sd "> array([1, 2, 2])</ span >
957
961
@@ -1053,13 +1057,14 @@ <h1>Source code for dpnp.dpnp_array</h1><div class="highlight"><pre>
1053
1057
< span class ="sd "> order : {"C", "F", "A", "K"}, optional</ span >
1054
1058
< span class ="sd "> Memory layout of the newly output array.</ span >
1055
1059
< span class ="sd "> Default: ``"C"``.</ span >
1056
- < span class ="sd "> device : {None, string, SyclDevice, SyclQueue}, optional</ span >
1060
+ < span class ="sd "> device : {None, string, SyclDevice, SyclQueue, Device }, optional</ span >
1057
1061
< span class ="sd "> An array API concept of device where the output array is created.</ span >
1058
- < span class ="sd "> The `device` can be ``None`` (the default), an OneAPI filter</ span >
1059
- < span class ="sd "> selector string, an instance of :class:`dpctl.SyclDevice`</ span >
1060
- < span class ="sd "> corresponding to a non-partitioned SYCL device, an instance of</ span >
1061
- < span class ="sd "> :class:`dpctl.SyclQueue`, or a `Device` object returned by</ span >
1062
- < span class ="sd "> :obj:`dpnp.dpnp_array.dpnp_array.device` property.</ span >
1062
+ < span class ="sd "> `device` can be ``None``, a oneAPI filter selector string,</ span >
1063
+ < span class ="sd "> an instance of :class:`dpctl.SyclDevice` corresponding to</ span >
1064
+ < span class ="sd "> a non-partitioned SYCL device, an instance of</ span >
1065
+ < span class ="sd "> :class:`dpctl.SyclQueue`, or a :class:`dpctl.tensor.Device` object</ span >
1066
+ < span class ="sd "> returned by :attr:`dpnp.ndarray.device`.</ span >
1067
+
1063
1068
< span class ="sd "> Default: ``None``.</ span >
1064
1069
< span class ="sd "> usm_type : {None, "device", "shared", "host"}, optional</ span >
1065
1070
< span class ="sd "> The type of SYCL USM allocation for the output array.</ span >
@@ -2027,12 +2032,13 @@ <h1>Source code for dpnp.dpnp_array</h1><div class="highlight"><pre>
2027
2032
2028
2033
< span class ="sd "> Parameters</ span >
2029
2034
< span class ="sd "> ----------</ span >
2030
- < span class ="sd "> device : {string, SyclDevice, SyclQueue}</ span >
2031
- < span class ="sd "> Array API concept of target device. It can be an OneAPI filter</ span >
2032
- < span class ="sd "> selector string, an instance of :class:`dpctl.SyclDevice`</ span >
2033
- < span class ="sd "> corresponding to a non-partitioned SYCL device, an instance of</ span >
2035
+ < span class ="sd "> device : {None, string, SyclDevice, SyclQueue, Device}, optional</ span >
2036
+ < span class ="sd "> An array API concept of device where the output array is created.</ span >
2037
+ < span class ="sd "> `device` can be ``None``, a oneAPI filter selector string,</ span >
2038
+ < span class ="sd "> an instance of :class:`dpctl.SyclDevice` corresponding to</ span >
2039
+ < span class ="sd "> a non-partitioned SYCL device, an instance of</ span >
2034
2040
< span class ="sd "> :class:`dpctl.SyclQueue`, or a :class:`dpctl.tensor.Device` object</ span >
2035
- < span class ="sd "> returned by :obj :`dpnp.dpnp_array.dpnp_array. device` property .</ span >
2041
+ < span class ="sd "> returned by :attr :`dpnp.ndarray. device`.</ span >
2036
2042
< span class ="sd "> stream : {SyclQueue, None}, optional</ span >
2037
2043
< span class ="sd "> Execution queue to synchronize with. If ``None``, synchronization</ span >
2038
2044
< span class ="sd "> is not performed.</ span >
0 commit comments