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:
David González Martínez
2024-04-09 02:03:27 +02:00
committed by GitHub
parent 46850a0269
commit 980124a605
2 changed files with 4 additions and 0 deletions

View File

@@ -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())