MCPcopy Index your code
hub / github.com/scikit-learn/scikit-learn / size

Function size

sklearn/utils/_array_api.py:251–264  ·  view source on GitHub ↗

Return the total number of elements of x. Parameters ---------- x : array Array instance from NumPy or an array API compatible library. Returns ------- out : int Total number of elements.

(x)

Source from the content-addressed store, hash-verified

249
250
251def size(x):
252 """Return the total number of elements of x.
253
254 Parameters
255 ----------
256 x : array
257 Array instance from NumPy or an array API compatible library.
258
259 Returns
260 -------
261 out : int
262 Total number of elements.
263 """
264 return math.prod(x.shape)
265
266
267def _is_numpy_namespace(xp):

Callers 12

_joint_log_likelihoodMethod · 0.90
fitMethod · 0.90
predict_probaMethod · 0.90
compute_class_weightFunction · 0.90
_cgFunction · 0.90
partial_fitMethod · 0.90
fitMethod · 0.90
predict_probaMethod · 0.90
_in1dFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…