提交 73d2d0a3 authored 作者: affanv14's avatar affanv14

Changed grad to L_op in basic_scipy.py

上级 d92efdc7
......@@ -30,12 +30,12 @@ class Erf(UnaryScalarOp):
else:
super(Erf, self).impl(x)
def grad(self, inp, grads):
x, = inp
def L_op(self, inputs, outputs, grads):
x, = inputs
gz, = grads
if x.type in complex_types:
raise NotImplementedError()
if self(x).type in discrete_types:
if outputs[0].type in discrete_types:
if x.type in discrete_types:
return [x.zeros_like(dtype=theano.config.floatX)]
else:
......@@ -61,12 +61,12 @@ class Erfc(UnaryScalarOp):
else:
super(Erfc, self).impl(x)
def grad(self, inp, grads):
x, = inp
def L_op(self, inputs, outputs, grads):
x, = inputs
gz, = grads
if x.type in complex_types:
raise NotImplementedError()
if self(x).type in discrete_types:
if outputs[0].type in discrete_types:
if x.type in discrete_types:
return [x.zeros_like(dtype=theano.config.floatX)]
else:
......@@ -108,12 +108,12 @@ class Erfcx(UnaryScalarOp):
else:
super(Erfcx, self).impl(x)
def grad(self, inp, grads):
x, = inp
def L_op(self, inputs, outputs, grads):
x, = inputs
gz, = grads
if x.type in complex_types:
raise NotImplementedError()
if self(x).type in discrete_types:
if outputs[0].type in discrete_types:
if x.type in discrete_types:
return [x.zeros_like(dtype=theano.config.floatX)]
else:
......@@ -144,12 +144,12 @@ class Erfinv(UnaryScalarOp):
else:
super(Erfinv, self).impl(x)
def grad(self, inp, grads):
x, = inp
def L_op(self, inputs, outputs, grads):
x, = inputs
gz, = grads
if x.type in complex_types:
raise NotImplementedError()
if self(x).type in discrete_types:
if outputs[0].type in discrete_types:
if x.type in discrete_types:
return [x.zeros_like(dtype=theano.config.floatX)]
else:
......@@ -177,12 +177,12 @@ class Erfcinv(UnaryScalarOp):
else:
super(Erfcinv, self).impl(x)
def grad(self, inp, grads):
x, = inp
def L_op(self, inputs, outputs, grads):
x, = inputs
gz, = grads
if x.type in complex_types:
raise NotImplementedError()
if self(x).type in discrete_types:
if outputs[0].type in discrete_types:
if x.type in discrete_types:
return [x.zeros_like(dtype=theano.config.floatX)]
else:
......@@ -214,12 +214,12 @@ class Gamma(UnaryScalarOp):
else:
super(Gamma, self).impl(x)
def grad(self, inputs, gout):
def L_op(self, inputs, outputs, gout):
(x,) = inputs
(gz,) = gout
if x.type in complex_types:
raise NotImplementedError()
if self(x).type in discrete_types:
if outputs[0].type in discrete_types:
if x.type in discrete_types:
return [x.zeros_like(dtype=theano.config.floatX)]
else:
......@@ -251,12 +251,12 @@ class GammaLn(UnaryScalarOp):
else:
super(GammaLn, self).impl(x)
def grad(self, inp, grads):
x, = inp
def L_op(self, inputs, outputs, grads):
x, = inputs
gz, = grads
if x.type in complex_types:
raise NotImplementedError()
if self(x).type in discrete_types:
if outputs[0].type in discrete_types:
if x.type in discrete_types:
return [x.zeros_like(dtype=theano.config.floatX)]
else:
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论