class Chainer::Functions::Math::Mul

Public Instance Methods

backward(indexes, gy) click to toggle source
# File lib/chainer/functions/math/basic_math.rb, line 62
def backward(indexes, gy)
  xs = get_retained_inputs
  indexes.map { |i| gy[0] * xs[1 - i] }
end
forward(x) click to toggle source
# File lib/chainer/functions/math/basic_math.rb, line 57
def forward(x)
  retain_inputs([0, 1])
  [Utils::Array.force_array(x[0] * x[1])]
end