mirror of
https://github.com/tinygrad/tinygrad.git
synced 2026-04-29 03:00:14 -04:00
add lerp operation to tensor (#4102)
* feat: add lerp operation to tensor * fix * style: fit in one line: * tests: test backward for lerp
This commit is contained in:
committed by
GitHub
parent
46850a0269
commit
980124a605
@@ -282,6 +282,9 @@ class TestOps(unittest.TestCase):
|
||||
helper_test_op([(45,35)], lambda x: x.round(), forward_only=True)
|
||||
helper_test_op(None, lambda x: x.round(), vals=[[1.499, 1.5, 1.501, 1.0, 2.1, 0.0, -5.0, -2.499, -2.5, -2.501]], forward_only=True)
|
||||
helper_test_op(None, lambda x: x.round(), vals=[[2.5, -1.5]], forward_only=True)
|
||||
def test_lerp(self):
|
||||
helper_test_op([(45,35), (45,35), (45,35)], lambda x,y,z: x.lerp(y,z))
|
||||
helper_test_op(None, lambda x,y,z: x.lerp(y,z), vals=[[1.,2.,3.], [4.,5.,6.], 0.5])
|
||||
|
||||
def test_tril(self):
|
||||
helper_test_op([(3,3)], lambda x: x.tril())
|
||||
|
||||
Reference in New Issue
Block a user