MCPcopy
hub / github.com/tinygrad/tinygrad / max

Method max

tinygrad/dtype.py:89–91  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

87 return -float("inf") if dtypes.is_float(self) else False
88 @functools.cached_property
89 def max(self):
90 if dtypes.is_int(self): return 2**(self.scalar().bitsize)-1+self.min
91 return float("inf") if dtypes.is_float(self) else True
92 def const(self, val: tuple[ConstType, ...]|ConstType):
93 if isinstance(val, tuple):
94 assert len(val) == self.count, f"mismatch {val} {self}"

Callers 15

evaluateFunction · 0.45
halide_gemm.pyFile · 0.45
test_reduce_maxFunction · 0.45
backend.pyFile · 0.45
_local_abs_max_fxnFunction · 0.45
scalar_amaxFunction · 0.45
fa.pyFile · 0.45
matmul.pyFile · 0.45
gaussian_kernelFunction · 0.45
sampleFunction · 0.45

Calls 3

scalarMethod · 0.95
is_intMethod · 0.80
is_floatMethod · 0.80

Tested by 15

test_reduce_maxFunction · 0.36
test_add_max_ucharMethod · 0.36
test_functionsMethod · 0.36
test_max_w_aluMethod · 0.36
test_randn_finiteMethod · 0.36
_testMethod · 0.36
test_bool_zero_maxMethod · 0.36
test_const_maxMethod · 0.36
test_max_nanMethod · 0.36
test_max_emptyMethod · 0.36