o
    ?e	                     @   sH   d Z ddlmZ ddlmZ edg ddd Zedg dd	d
 ZdS )z5A module for interm merge-call related internal APIs.    )distribute_lib)	tf_exportz7__internal__.distribute.strategy_supports_no_merge_call)v1c                  C   s    t  sdS t  } | j  S )zFReturns if the current `Strategy` can operate in pure replica context.T)r   Zhas_strategyZget_strategyextendedZ_use_merge_call)strategy r   p/home/www/facesmatcher.com/pyenv/lib/python3.10/site-packages/tensorflow/python/distribute/merge_call_interim.pystrategy_supports_no_merge_call   s   r	   z0__internal__.distribute.interim.maybe_merge_callc                 O   s0   t  r| |g|R i |S t j| ||dS )a  Maybe invoke `fn` via `merge_call` which may or may not be fulfilled.

  The caller of this utility function requests to invoke `fn` via `merge_call`
  at `tf.distribute.Strategy`'s best efforts. It is `tf.distribute`'s internal
  whether the request is honored, depending on the `Strategy`. See
  `tf.distribute.ReplicaContext.merge_call()` for more information.

  This is an interim API which is subject to removal and does not guarantee
  backward-compatibility.

  Args:
    fn: the function to be invoked.
    strategy: the `tf.distribute.Strategy` to call `fn` with.
    *args: the positional arguments to be passed in to `fn`.
    **kwargs: the keyword arguments to be passed in to `fn`.

  Returns:
    The return value of the `fn` call.
  )argskwargs)r	   r   Zget_replica_contextZ
merge_call)fnr   r
   r   r   r   r   maybe_merge_call   s
   r   N)__doc__Ztensorflow.python.distributer   Z tensorflow.python.util.tf_exportr   r	   r   r   r   r   r   <module>   s   


