mirror of
https://github.com/tinygrad/tinygrad.git
synced 2026-06-24 02:14:17 +00:00
hotfix: add note to relu
This commit is contained in:
parent
c6cbf0145a
commit
c46edbf262
1 changed files with 1 additions and 0 deletions
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue