Class: Chainer::Functions::Math::MulConstant
Instance Attribute Summary
#inputs, #outputs, #rank
Instance Method Summary
collapse
#apply, #backward_accumulate, #forward_cpu, #get_retained_inputs, #get_retained_outputs, #label, #output_data, #retain_inputs, #retain_outputs, #unchain
Constructor Details
69
70
71
|
# File 'lib/chainer/functions/math/basic_math.rb', line 69
def initialize(value)
@value = value
end
|
Instance Method Details
#backward(indexes, gy) ⇒ Object
77
78
79
|
# File 'lib/chainer/functions/math/basic_math.rb', line 77
def backward(indexes, gy)
[gy[0] * @value]
end
|
#forward(x) ⇒ Object
73
74
75
|
# File 'lib/chainer/functions/math/basic_math.rb', line 73
def forward(x)
[Utils::Array.force_array(@value * x[0])]
end
|