MCPcopy Index your code
hub / github.com/dask/dask / cached_max

Function cached_max

dask/utils.py:2101–2122  ·  view source on GitHub ↗

Compute max with caching. Caching is by the identity of `seq` rather than the value. It is thus important that `seq` is a tuple of immutable objects, and this function is intended for use where `seq` is a value that will persist (generally block sizes). Parameters ---------

(seq)

Source from the content-addressed store, hash-verified

2099
2100
2101def cached_max(seq):
2102 """Compute max with caching.
2103
2104 Caching is by the identity of `seq` rather than the value. It is thus
2105 important that `seq` is a tuple of immutable objects, and this function
2106 is intended for use where `seq` is a value that will persist (generally
2107 block sizes).
2108
2109 Parameters
2110 ----------
2111 seq : tuple
2112 Values to reduce
2113
2114 Returns
2115 -------
2116 tuple
2117 """
2118 assert isinstance(seq, tuple)
2119 # Look up by identity first, to avoid a linear-time __hash__
2120 # if we've seen this tuple object before.
2121 result = _max(_HashIdWrapper(seq))
2122 return result
2123
2124
2125def cached_cumsum(seq, initial_zero=False):

Callers 2

chunksizeMethod · 0.90
einsumFunction · 0.90

Calls 2

_maxFunction · 0.85
_HashIdWrapperClass · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…