MCPcopy
hub / github.com/scikit-learn/scikit-learn / delayed

Function delayed

sklearn/utils/parallel.py:95–125  ·  view source on GitHub ↗

Decorator used to capture the arguments of a function. This alternative to `joblib.delayed` is meant to be used in conjunction with `sklearn.utils.parallel.Parallel`. The latter captures the scikit- learn configuration by calling `sklearn.get_config()` in the current thread, prior t

(function)

Source from the content-addressed store, hash-verified

93
94# remove when https://github.com/joblib/joblib/issues/1071 is fixed
95def delayed(function):
96 """Decorator used to capture the arguments of a function.
97
98 This alternative to `joblib.delayed` is meant to be used in conjunction
99 with `sklearn.utils.parallel.Parallel`. The latter captures the scikit-
100 learn configuration by calling `sklearn.get_config()` in the current
101 thread, prior to dispatching the first task. The captured configuration is
102 then propagated and enabled for the duration of the execution of the
103 delayed function in the joblib workers.
104
105 .. versionchanged:: 1.3
106 `delayed` was moved from `sklearn.utils.fixes` to `sklearn.utils.parallel`
107 in scikit-learn 1.3.
108
109 Parameters
110 ----------
111 function : callable
112 The function to be delayed.
113
114 Returns
115 -------
116 output: tuple
117 Tuple containing the delayed function, the positional arguments, and the
118 keyword arguments.
119 """
120
121 @functools.wraps(function)
122 def delayed_function(*args, **kwargs):
123 return _FuncWrapper(function), args, kwargs
124
125 return delayed_function
126
127
128class _FuncWrapper:

Callers 15

fitMethod · 0.90
fitMethod · 0.90
partial_fitMethod · 0.90
fitMethod · 0.90
partial_fitMethod · 0.90
fitMethod · 0.90
_parallel_funcMethod · 0.90
transformMethod · 0.90
partial_fitMethod · 0.90
fitMethod · 0.90
predictMethod · 0.90
cross_validateFunction · 0.90

Calls

no outgoing calls

Used in the wild real call sites across dependent graphs

searching dependent graphs…