Class: Gsplat::Ops::Exp

Inherits:
Autograd::Function show all
Defined in:
lib/gsplat/ops/tensor_value_ops.rb

Overview

Elementwise exponential activation.

Class Method Summary collapse

Methods inherited from Autograd::Function

apply

Class Method Details

.backward(context, gradient) ⇒ Object



52
53
54
# File 'lib/gsplat/ops/tensor_value_ops.rb', line 52

def backward(context, gradient)
  [gradient * context.saved_values.first]
end

.forward(context, value) ⇒ Object



46
47
48
49
50
# File 'lib/gsplat/ops/tensor_value_ops.rb', line 46

def forward(context, value)
  output = Numo::NMath.exp(value)
  context.save(output)
  output
end