ops enum cleanup

This commit is contained in:
George Hotz
2022-06-09 08:42:42 -07:00
parent e01ed64d7c
commit 6dcaee2361
2 changed files with 4 additions and 20 deletions

View File

@@ -22,22 +22,6 @@ def binary_broadcast(x_shape, y_shape, extra=False):
return (shape_ret, dimlist, complist) if extra else shape_ret
from enum import Enum
class UnaryOps(Enum):
RELU = 0
EXP = 1
LOG = 2
NEG = 3
SIGN = 4
class BinaryOps(Enum):
ADD = 0
SUB = 1
MUL = 2
DIV = 3
POW = 4
A = 5
CMPEQ = 6
class ReduceOps(Enum):
SUM = 0
MAX = 1
UnaryOps = Enum("UnaryOps", ["RELU", "EXP", "LOG", "NEG", "SIGN"])
BinaryOps = Enum("BinaryOps", ["ADD", "SUB", "MUL", "DIV", "POW", "A", "CMPEQ"])
ReduceOps = Enum("ReduceOps", ["SUM", "MAX"])

View File

@@ -427,4 +427,4 @@ for device in [device for device in Device.__dict__.keys() if device[0] != "_"]:
# this registers all the mlops "math" operations
for name, cls in inspect.getmembers(importlib.import_module('tinygrad.mlops'), inspect.isclass):
if name[0] != "_" and name != "Function": register(name.lower(), cls)
if name[0] != "_" and name != "Function" and not name.endswith("Ops"): register(name.lower(), cls)