MCPcopy Create free account
hub / github.com/rtqichen/torchdiffeq / forward

Method forward

examples/bouncing_ball.py:25–29  ·  view source on GitHub ↗
(self, t, state)

Source from the content-addressed store, hash-verified

23 self.odeint = odeint_adjoint if adjoint else odeint
24
25 def forward(self, t, state):
26 pos, vel, log_radius = state
27 dpos = vel
28 dvel = -self.gravity
29 return dpos, dvel, torch.zeros_like(log_radius)
30
31 def event_fn(self, t, state):
32 # positive if ball in mid-air, negative if ball within ground.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected