提交 4141a359 authored 作者: Nicolas Bouchard's avatar Nicolas Bouchard

Made corrections.

上级 a8e7bab7
......@@ -86,6 +86,11 @@ class Gamma(UnaryScalarOp):
def grad(self, (x, ), (gz, )):
return gz * gamma(x) * psi(x),
def c_code(self, node, name, (x, ), (z, ), sub):
if node.inputs[0].type in float_types:
return """%(z)s = tgamma(%(x)s);""" % locals()
raise NotImplementedError('only floating point is implemented')
def __eq__(self, other):
return type(self) == type(other)
......
......@@ -259,6 +259,10 @@ def mod_inplace(a, b):
def pow_inplace(a, b):
"""elementwise power (inplace on `a`)"""
@_scal_inplace
def conj_inplace(a):
"""elementwise conjugate (inplace on `a`)"""
pprint.assign(add_inplace, printing.OperatorPrinter('+=', -2, 'either'))
pprint.assign(mul_inplace, printing.OperatorPrinter('*=', -1, 'either'))
pprint.assign(sub_inplace, printing.OperatorPrinter('-=', -2, 'left'))
......
......@@ -1383,6 +1383,12 @@ ConjTester = makeBroadcastTester(
op=tensor.conj,
expected=numpy.conj,
good=_good_broadcast_unary_normal)
ConjInplaceTester = makeBroadcastTester(
op=tensor.conj,
expected=numpy.conj,
good=_good_broadcast_unary_normal,
inplace=True)
DotTester = makeTester(name = 'DotTester',
op = dot,
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论