that lambda is required
MODIFY
tinygrad/tensor.py
tinygrad/tensor.py
@@ -349,7 +349,7 @@ for device in [device for device in Device.__dict__.keys() if device[0] != "_"]:
# register all the mlops "math" operations
def register(name:str, fxn:Function):
- setattr(Tensor, "_"+name if hasattr(Tensor, name) else name, lambda *args, **kwargs: fxn.apply(*args, **kwargs))
+ setattr(Tensor, "_"+name if hasattr(Tensor, name) else name, lambda *args, **kwargs: fxn.apply(*args, **kwargs)) # doesn't work without lambda, pylint: disable=W0108
for name, cls in inspect.getmembers(importlib.import_module('tinygrad.mlops'), inspect.isclass):
if name[0] != "_" and name != "Function" and not name.endswith("Ops"):
register(name.lower(), cls)

that lambda is required