o
    ®Ÿ?e	  ã                   @   s<   d Z ddlmZ ddlmZ edgd			d
dd	„ƒZdS )zBasic loop for training.é    )Úerrors)Ú	tf_exportztrain.basic_train_loop)Úv1NÚ c                 C   sž   |du rg }|du ri }d}|rMz,d}|   |¡}|  ¡ s,||g|¢R i |¤Ž |  ¡ rW d  ƒ n1 s6w   Y  W n tjyH   d}Y nw |sdS dS )a(  Basic loop to train a model.

  Calls `train_step_fn` in a loop to train a model.  The function is called as:

  ```python
  train_step_fn(session, *args, **kwargs)
  ```

  It is passed a `tf.compat.v1.Session` in addition to `args` and `kwargs`.  The
  function
  typically runs one training step in the session.

  Args:
    supervisor: `tf.compat.v1.train.Supervisor` to run the training services.
    train_step_fn: Callable to execute one training step.  Called repeatedly as
      `train_step_fn(session, *args **kwargs)`.
    args: Optional positional arguments passed to `train_step_fn`.
    kwargs: Optional keyword arguments passed to `train_step_fn`.
    master: Master to use to create the training session.  Defaults to `""`
      which causes the session to be created in the local process.
  NTF)Zmanaged_sessionZshould_stopr   ZAbortedError)Z
supervisorZtrain_step_fnÚargsÚkwargsZmasterZshould_retryÚsess© r	   úg/home/www/facesmatcher.com/pyenv/lib/python3.10/site-packages/tensorflow/python/training/basic_loops.pyÚbasic_train_loop   s&   ÿ€ÿ€ýúr   )NNr   )Ú__doc__Ztensorflow.python.frameworkr   Z tensorflow.python.util.tf_exportr   r   r	   r	   r	   r
   Ú<module>   s   
ü