class Chainer::Functions::Math::MulConstant

Public Class Methods

new(value) click to toggle source
# File lib/chainer/functions/math/basic_math.rb, line 69
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 77
def backward(indexes, gy)
  [gy[0] * @value]
end
forward(x) click to toggle source
# File lib/chainer/functions/math/basic_math.rb, line 73
def forward(x)
  [Utils::Array.force_array(@value * x[0])]
end