mirror of
https://github.com/tinygrad/tinygrad.git
synced 2026-01-22 21:38:10 -05:00
ops enum cleanup
This commit is contained in:
@@ -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"])
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user