add smin/smax (#7253)

* add smin/smax

* don't create var with var

* better test errors

* add failing test

* enable shape simplification

* fix tests

* Update view.py

* simpler and simplify
This commit is contained in:
George Hotz
2024-10-24 15:10:49 +07:00
committed by GitHub
parent de7b9d7c42
commit 532b7b018c
6 changed files with 36 additions and 12 deletions

View File

@@ -55,6 +55,14 @@ class TestTensorVariable(unittest.TestCase):
ret = t.var().item()
assert ret == 0
def test_symbolic_pad2d(self):
vv = Variable("a", 1, 10).bind(2)
t = Tensor.ones(2, 2).contiguous()
t = t.pad2d([vv, vv, vv, vv]).mean()
ones = 4
zeros = 6+6+4+4+6+6
self.assertAlmostEqual(t.item(), ones/(ones+zeros))
@unittest.skip("symbolic arange isn't supported")
def test_symbolic_arange(self):
vv = Variable("a", 1, 10).bind(2)