Class: Gsplat::Autograd::GraphNode
- Inherits:
-
Object
- Object
- Gsplat::Autograd::GraphNode
- Defined in:
- lib/gsplat/autograd/function.rb
Overview
A recorded invocation shared by all outputs of one Function.
Instance Attribute Summary collapse
-
#context ⇒ Object
readonly
Returns the value of attribute context.
-
#function ⇒ Object
readonly
Returns the value of attribute function.
-
#inputs ⇒ Object
readonly
Returns the value of attribute inputs.
-
#outputs ⇒ Object
Returns the value of attribute outputs.
Instance Method Summary collapse
-
#backward(*grad_outputs) ⇒ Object
private
Delegates output gradients to the operation's backward method.
-
#initialize(function, context, inputs) ⇒ GraphNode
constructor
A new instance of GraphNode.
-
#release ⇒ Object
private
Releases graph references after a backward traversal.
Constructor Details
#initialize(function, context, inputs) ⇒ GraphNode
Returns a new instance of GraphNode.
10 11 12 13 14 15 |
# File 'lib/gsplat/autograd/function.rb', line 10 def initialize(function, context, inputs) @function = function @context = context @inputs = inputs @outputs = [] end |
Instance Attribute Details
#context ⇒ Object (readonly)
Returns the value of attribute context.
7 8 9 |
# File 'lib/gsplat/autograd/function.rb', line 7 def context @context end |
#function ⇒ Object (readonly)
Returns the value of attribute function.
7 8 9 |
# File 'lib/gsplat/autograd/function.rb', line 7 def function @function end |
#inputs ⇒ Object (readonly)
Returns the value of attribute inputs.
7 8 9 |
# File 'lib/gsplat/autograd/function.rb', line 7 def inputs @inputs end |
#outputs ⇒ Object
Returns the value of attribute outputs.
8 9 10 |
# File 'lib/gsplat/autograd/function.rb', line 8 def outputs @outputs end |
Instance Method Details
#backward(*grad_outputs) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Delegates output gradients to the operation's backward method.
19 20 21 |
# File 'lib/gsplat/autograd/function.rb', line 19 def backward(*grad_outputs) function.backward(context, *grad_outputs) end |
#release ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Releases graph references after a backward traversal.
25 26 27 28 29 30 |
# File 'lib/gsplat/autograd/function.rb', line 25 def release outputs.each { |output| output.clear_creator(self) } context.clear @inputs = [] @outputs = [] end |