@@ -197,28 +197,28 @@ def deprecate(*args, **kwargs):
197
197
def deprecate_with_doc (msg ):
198
198
"""
199
199
Deprecates a function and includes the deprecation in its docstring.
200
-
201
- This function is used as a decorator. It returns an object that can be
202
- used to issue a DeprecationWarning, by passing the to-be decorated
203
- function as argument, this adds warning to the to-be decorated function's
200
+
201
+ This function is used as a decorator. It returns an object that can be
202
+ used to issue a DeprecationWarning, by passing the to-be decorated
203
+ function as argument, this adds warning to the to-be decorated function's
204
204
docstring and returns the new function object.
205
-
205
+
206
206
See Also
207
207
--------
208
- deprecate : Decorate a function such that it issues a `DeprecationWarning`
209
-
208
+ deprecate : Decorate a function such that it issues a `DeprecationWarning`
209
+
210
210
Parameters
211
211
----------
212
212
msg : str
213
- Additional explanation of the deprecation. Displayed in the
213
+ Additional explanation of the deprecation. Displayed in the
214
214
docstring after the warning.
215
215
216
216
Returns
217
217
-------
218
218
obj : object
219
219
220
220
"""
221
- return _Deprecate (message = msg )
221
+ return _Deprecate (message = msg )
222
222
223
223
224
224
#--------------------------------------------
@@ -1042,4 +1042,30 @@ def _median_nancheck(data, result, axis, out):
1042
1042
result [n ] = np .nan
1043
1043
return result
1044
1044
1045
+ def _opt_info ():
1046
+ """
1047
+ Returns a string contains the supported CPU features by the current build.
1048
+
1049
+ The string format can be explained as follows:
1050
+ - dispatched features that are supported by the running machine
1051
+ end with `*`.
1052
+ - dispatched features that are "not" supported by the running machine
1053
+ end with `?`.
1054
+ - remained features are representing the baseline.
1055
+ """
1056
+ from numpy .core ._multiarray_umath import (
1057
+ __cpu_features__ , __cpu_baseline__ , __cpu_dispatch__
1058
+ )
1059
+
1060
+ if len (__cpu_baseline__ ) == 0 and len (__cpu_dispatch__ ) == 0 :
1061
+ return ''
1062
+
1063
+ enabled_features = ' ' .join (__cpu_baseline__ )
1064
+ for feature in __cpu_dispatch__ :
1065
+ if __cpu_features__ [feature ]:
1066
+ enabled_features += f" { feature } *"
1067
+ else :
1068
+ enabled_features += f" { feature } ?"
1069
+
1070
+ return enabled_features
1045
1071
#-----------------------------------------------------------------------------
0 commit comments