From c71a8ef22229e841ccbf176bf47e354420ae679a Mon Sep 17 00:00:00 2001 From: George Hotz Date: Sun, 6 Dec 2020 13:02:12 -0800 Subject: [PATCH] remove unused Div op --- tinygrad/ops.py | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/tinygrad/ops.py b/tinygrad/ops.py index cffe600a49..43b4c6439d 100644 --- a/tinygrad/ops.py +++ b/tinygrad/ops.py @@ -45,19 +45,6 @@ class Mul(Function): return unbroadcast(y*grad_output, x.shape), unbroadcast(x*grad_output, y.shape) register('mul', Mul) -class Div(Function): - @staticmethod - def forward(ctx, x, y): - ctx.save_for_backward(x, y) - return x / y - - @staticmethod - def backward(ctx, grad_output): - x,y = ctx.saved_tensors - return unbroadcast(grad_output / y, x.shape), unbroadcast(-x * grad_output / y**2, y.shape) -# TODO: registering this breaks the default div on the GPU -#register('div', Div) - class Pow(Function): @staticmethod def forward(ctx, x, y):