mirror of
https://github.com/tinygrad/tinygrad.git
synced 2026-01-09 15:08:02 -05:00
Fix Tensor's __repr__ for printing out grad (#3673)
* update check for Tensor's __repr__ with grad * add test for repr with grad bugfix
This commit is contained in:
@@ -334,6 +334,12 @@ class TestTinygrad(unittest.TestCase):
|
||||
with self.assertRaises(TypeError):
|
||||
_a = Tensor([3]) in [Tensor([3]), Tensor([4]), Tensor([5])]
|
||||
|
||||
def test_repr_with_grad(self):
|
||||
a = Tensor([1])
|
||||
b = Tensor([1])
|
||||
c = (a + b).mean().backward()
|
||||
print(c)
|
||||
|
||||
@unittest.skipIf(CI and Device.DEFAULT in {"GPU", "CUDA", "METAL"}, "no GPU CI")
|
||||
class TestMoveTensor(unittest.TestCase):
|
||||
d0, d1 = f"{Device.DEFAULT}:0", f"{Device.DEFAULT}:1"
|
||||
|
||||
Reference in New Issue
Block a user