o
    zi`                     @   sH   d dl mZ d dlZd dlmZ d dlmZ ddeded	efd
dZdS )    )CallableN)Tensor)tqdm              ?xdrift_fnNc                 K   sv   |rdnd}| j ^}}	t|g| j| }
|| | }tt||dD ]}| ||
| fi ||  } |
|7 }
q%| S )a  
        A basic implementation of Euler discretisation method of the ODE associated 
        with the marginales of the learned SDE.
        
        x: Initial state
        drift_fn: Update the state x
        N: Number of steps
        t0: Initial time of integration, defaults to 0.
        t1: Final time of integration, defaults to 1.
        
        Returns the final state
        FT)disable)shapetorchonestodevicer   range)r   r   r	   t0t1verbosekwargsr
   BDtdt_ r   J/home/ubuntu/.local/lib/python3.10/site-packages/score_models/ode/euler.pyeuler   s   

r   )r   r   r   )typingr   r   r   r   intr   r   r   r   r   <module>   s
    