class Chainer::Functions::Math::AddConstant

Public Class Methods

new(value) click to toggle source
# File lib/chainer/functions/math/basic_math.rb, line 29
def initialize(value)
  @value = value
end

Public Instance Methods

backward(indexes, gy) click to toggle source
# File lib/chainer/functions/math/basic_math.rb, line 37
def backward(indexes, gy)
  [gy[0]]
end
forward(x) click to toggle source
# File lib/chainer/functions/math/basic_math.rb, line 33
def forward(x)
  [Utils::Array.force_array(x[0] + @value)]
end