Class: Chainer::Functions::Math::Add
- Inherits:
-
Chainer::FunctionNode
- Object
- Chainer::FunctionNode
- Chainer::Functions::Math::Add
- Defined in:
- lib/chainer/functions/math/basic_math.rb
Instance Attribute Summary
Attributes inherited from Chainer::FunctionNode
Instance Method Summary collapse
Methods inherited from Chainer::FunctionNode
#apply, #backward_accumulate, #forward_cpu, #get_retained_inputs, #get_retained_outputs, #initialize, #label, #output_data, #retain_inputs, #retain_outputs, #unchain
Constructor Details
This class inherits a constructor from Chainer::FunctionNode
Instance Method Details
#backward(indexes, gy) ⇒ Object
23 24 25 |
# File 'lib/chainer/functions/math/basic_math.rb', line 23 def backward(indexes, gy) [gy[0], gy[0]] end |
#forward(x) ⇒ Object
19 20 21 |
# File 'lib/chainer/functions/math/basic_math.rb', line 19 def forward(x) [Utils::Array.force_array(x[0] + x[1])] end |