From c46edbf262d2cbaf5baffa4bece88def0539dc3a Mon Sep 17 00:00:00 2001 From: George Hotz Date: Thu, 22 May 2025 09:13:38 -0700 Subject: [PATCH] hotfix: add note to relu --- tinygrad/tensor.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tinygrad/tensor.py b/tinygrad/tensor.py index 005b7add88..6e54caca72 100644 --- a/tinygrad/tensor.py +++ b/tinygrad/tensor.py @@ -2824,6 +2824,7 @@ class Tensor(SimpleMathTrait): print(Tensor([-3., -2., -1., 0., 1., 2., 3.]).relu().numpy()) ``` """ + # NOTE: if you write this as self.maximum(0) the gradient is wrong, passing through half when self is 0 return (self>0).where(self, 0) def sigmoid(self) -> Tensor: