code: def sdeint(
      sde,
      y0: Tensor,
      ts: Vector,
      bm: Optional[BaseBrownian] = None,
      method: Optional[str] = None,
      dt: Scalar = 1e-3,
      adaptive: bool = False,
      rtol: Scalar = 1e-5,
      atol: Scalar = 1e-4,
      dt_min: Scalar = 1e-5,
      options: Optional[Dict[str, Any]] = None,
      names: Optional[Dict[str, str]] = None,
      logqp: bool = False,
      extra: bool = False,
      extra_solver_state: Optional[Tensors] = None,
      **unused_kwargs,
  ) -> TensorOrTensors:
      """Numerically integrate an SDE.
  
      Args:
          sde: Object with methods `f` and `g` representing the
              drift and diffusion. The output of `g` should be a single tensor of
              size (batch_size, d) for diagonal noise SDEs or (batch_size, d, m)
              for SDEs of other noise types; d is the dimensionality of state and
              m is the dimensionality of Brownian motion.
          y0 (Tensor): A tensor for the initial state.
          ts (Tensor or sequence of float): Query times in non-descending order.
              The state at the first time of `ts` should be `y0`.
          bm (Brownian, optional): A 'BrownianInterval', `BrownianPath` or
              `BrownianTree` object. Should return tensors of size (batch_size, m)
              for `__call__`. Defaults to `BrownianInterval`.
          method (str, optional): Numerical integration method to use. Must be
              compatible with the SDE type (Ito/Stratonovich) and the noise type
              (scalar/additive/diagonal/general). Defaults to a sensible choice
              depending on the SDE type and noise type of the supplied SDE.
          dt (float, optional): The constant step size or initial step size for
              adaptive time-stepping.
          adaptive (bool, optional): If `True`, use adaptive time-stepping.
          rtol (float, optional): Relative tolerance.
          atol (float, optional): Absolute tolerance.
          dt_min (float, optional): Minimum step size during integration.
          options (dict, optional): Dict of options for the integration method.
          names (dict, optional): Dict of method names for drift and diffusion.
              Expected keys are "drift" and "diffusion". Serves so that users can
              use methods with names not in `("f", "g")`, e.g. to use the
              method "foo" for the drift, we supply `names={"drift": "foo"}`.
          logqp (bool, optional): If `True`, also return the log-ratio penalty.
          extra (bool, optional): If `True`, also return the extra hidden state
              used internally in the solver.
          extra_solver_state: (tuple of Tensors, optional): Additional state to
              initialise the solver with. Some solvers keep track of additional
              state besides y0, and this offers a way to optionally initialise
              that state.
  
      Returns:
          A single state tensor of size (T, batch_size, d).
          if logqp is True, then the log-ratio penalty is also returned.
          If extra is True, the any extra internal state of the solver is also
          returned.
  
      Raises:
          ValueError: An error occurred due to unrecognized noise type/method,
              or if `sde` is missing required methods.
      """
      misc.handle_unused_kwargs(unused_kwargs, msg="`sdeint`")
      del unused_kwargs
  
      sde, y0, ts, bm, method, options = check_contract(
          sde, y0, ts, bm, method, adaptive, options, names, logqp
      )
      misc.assert_no_grad(
          ["ts", "dt", "rtol", "atol", "dt_min"],
          [ts, dt, rtol, atol, dt_min],
      )
  
      solver_fn = methods.select(method=method, sde_type=sde.sde_type)
      solver = solver_fn(
          sde=sde,
          bm=bm,
          dt=dt,
          adaptive=adaptive,
          rtol=rtol,
          atol=atol,
          dt_min=dt_min,
          options=options,
      )
      if extra_solver_state is None:
          extra_solver_state = solver.init_extra_solver_state(ts[0], y0)
      ys, extra_solver_state = solver.integrate(
          y0, ts, extra_solver_state
      )
  
      return parse_return(y0, ys, extra_solver_state, extra, logqp)
  
file_path: torchsde/torchsde/_core/sdeint.py
imports: import warnings
  import torch
  from .None import base_sde
  from .None import methods
  from .None import misc
  from .._brownian import BaseBrownian, BrownianInterval
  from ..settings import LEVY_AREA_APPROXIMATIONS, METHODS, NOISE_TYPES, SDE_TYPES
  from ..types import Any, Dict, Optional, Scalar, Tensor, Tensors, TensorOrTensors, Vector
label_desc: Use image node_id 1 for calling a global function with example usage: sdeint(sde, y0, ts, bm, method, dt, adaptive, rtol, atol, dt_min, options, names, logqp, extra, extra_solver_state) and returns: parse_return