mirror of
https://github.com/tinygrad/tinygrad.git
synced 2026-04-07 03:00:26 -04:00
use unravel in views_to_indexed_uops [pr] (#8560)
* use unravel in shape * make process replay work * earlier View.minify() * fix * fix tests * mypy * get rid of early minify * fix * linter * clean and add test --------- Co-authored-by: chenyu <chenyu@fastmail.com>
This commit is contained in:
@@ -398,6 +398,17 @@ class TestSymbolic(unittest.TestCase):
|
||||
self.helper_test_variable((idx0*v+idx1)//v, 0, 2, "(idx0)")
|
||||
self.helper_test_variable((idx0*v+idx1)%v, 0, start_pos, "idx1")
|
||||
|
||||
def test_divmod_variable_denom_fold_to_const(self):
|
||||
x = Variable("x", 20, 23)
|
||||
y = Variable("y", 8, 10)
|
||||
self.helper_test_variable(x//y, 2, 2, "2")
|
||||
self.helper_test_variable(x%y, 0, 7, "(x+(y*-2))")
|
||||
# ensure all 4 corners are checked
|
||||
x = Variable("x", -10, 10)
|
||||
y = Variable("y", -8, 9)
|
||||
self.helper_test_variable(x//y, -2147483648, 2147483647, "(x//y)")
|
||||
self.helper_test_variable(x%y, -2147483648, 2147483647, "(x%y)")
|
||||
|
||||
# TODO: simplify the expression
|
||||
def test_div_neg_all_range(self):
|
||||
gidx = Variable("gidx", 0, 124)
|
||||
|
||||
Reference in New Issue
Block a user