Skip to content

Commit

Permalink
Merge babb4ad into 391e2c0
Browse files Browse the repository at this point in the history
  • Loading branch information
unnonouno committed Aug 14, 2017
2 parents 391e2c0 + babb4ad commit c1292ca
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions chainer/functions/math/basic_math.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def _preprocess_const(x, value):
return utils.force_type(x.dtype, value)


class Neg(function.Function):
class Neg(function_node.FunctionNode):

@property
def label(self):
Expand All @@ -60,8 +60,8 @@ def forward(self, x):
self.retain_inputs(())
return utils.force_array(-x[0]),

def backward(self, x, gy):
return utils.force_array(-gy[0]),
def backward(self, indexes, gy):
return -gy[0],


def neg(self): # -x
Expand All @@ -70,7 +70,7 @@ def neg(self): # -x
Returns:
~chainer.Variable: Output variable.
"""
return Neg()(self)
return Neg().apply((self,))[0]


class Absolute(function.Function):
Expand Down

0 comments on commit c1292ca

Please sign in to comment.