MCPcopy
hub / github.com/tinygrad/tinygrad / test_replace

Method test_replace

test/null/test_uops.py:289–292  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

287 self.assertEqual((gidx0*3+1).const_factor(), 1)
288
289 def test_replace(self):
290 x = UOp(Ops.PARAM, dtypes.int.ptr(), (), 0)
291 self.assertIs(x.replace(arg=None).arg, None)
292 with self.assertRaises(AssertionError): x.replace(field="a")
293
294 def test_const_zero_neg_zero_different(self):
295 # -0.0 and 0.0 must be different UOps (for IEEE754 correctness, e.g. 1/-0.0 = -inf)

Callers

nothing calls this directly

Calls 3

replaceMethod · 0.95
UOpClass · 0.90
ptrMethod · 0.45

Tested by

no test coverage detected