espnet3.systems.f5tts.src.solvers.odeint
Less than 1 minute
espnet3.systems.f5tts.src.solvers.odeint
espnet3.systems.f5tts.src.solvers.odeint(func: Callable, y0: Tensor, t: Tensor, method: str = 'euler', **kwargs)
Fixed-step ODE integration over a caller-supplied time grid.
- Parameters:
- func – Derivative
func(t_scalar, y) -> dy/dt. - y0 – Initial state.
- t – 1-D time grid. Steps use
dt = t[i + 1] - t[i], so non-uniform grids (EPSS, sway sampling) work unchanged. - method –
"euler"or"midpoint". No other method is supported. - **kwargs – Accepted and ignored, so the
torchdiffeq.odeintcall signature stays a drop-in.
- func – Derivative
- Returns: Trajectory stacked as
[len(t), *y0.shape]withsolution[0] == y0, matchingtorchdiffeq.odeint, sosolution[-1]is the final state. - Raises:ValueError – If
methodis not"euler"or"midpoint".
Example
>>> sol = odeint(lambda t, y: y, torch.tensor([1.0]),
... torch.linspace(0, 1, 3))
>>> sol.shape
torch.Size([3, 1])NOTE
Both methods reproduce torchdiffeq’s fixed-step solvers exactly, so dropping that dependency changes no output. Returning the whole trajectory rather than just the endpoint is deliberate: it keeps the torchdiffeq signature, so this stays a drop-in replacement.
