提交 6c02a13d authored 作者: Ramana.S's avatar Ramana.S

extension of #3983

上级 5c31ea6b
...@@ -9,6 +9,7 @@ If you do want to rewrite these tests, bear in mind: ...@@ -9,6 +9,7 @@ If you do want to rewrite these tests, bear in mind:
* FunctionGraph and DualLinker are old, use compile.function instead. * FunctionGraph and DualLinker are old, use compile.function instead.
""" """
from __future__ import division
import unittest import unittest
import numpy as np import numpy as np
......
from __future__ import print_function from __future__ import print_function, division
import os import os
import shutil import shutil
import sys import sys
......
from __future__ import division
import numpy import numpy
from theano.tensor.elemwise import Elemwise from theano.tensor.elemwise import Elemwise
from theano import scalar from theano import scalar
...@@ -54,7 +54,7 @@ class XlogY0(scalar.BinaryScalarOp): ...@@ -54,7 +54,7 @@ class XlogY0(scalar.BinaryScalarOp):
def grad(self, inputs, grads): def grad(self, inputs, grads):
x, y = inputs x, y = inputs
gz, = grads gz, = grads
return [gz * scalar.log(y), gz * x / y] return [gz * scalar.log(y), gz * x/y]
def c_code(self, node, name, inputs, outputs, sub): def c_code(self, node, name, inputs, outputs, sub):
x, y = inputs x, y = inputs
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论