Interpreted cleanups (#2312)

* move the compiler out of ops

* don't return realized

* var_vals filter, fix custom

* typing
This commit is contained in:
George Hotz
2023-11-15 09:02:23 -08:00
committed by GitHub
parent 123a0b86b2
commit 4da2ddea6e
9 changed files with 85 additions and 86 deletions

View File

@@ -28,7 +28,7 @@ def atan2_gpu(ret:LazyBuffer, a:LazyBuffer, b:LazyBuffer):
return ret.realized
def atan2_cpu(ret:LazyBuffer, a:LazyBuffer, b:LazyBuffer):
return Device[ret.device].from_underlying(np.arctan2(a.realized._buf, b.realized._buf))
return Device[ret.device].buffer.fromCPU(np.arctan2(a.realized._buf, b.realized._buf))
# *** second, we write the ATan2 mlop ***
# NOTE: The derivative of atan2 doesn't need a custom op! https://www.liquisearch.com/atan2/derivative