
    AVh	                     `    d Z ddlmZ ddlmZ  edg       d        Z edg       d        Zy	)
z5A module for interm merge-call related internal APIs.    )distribute_lib)	tf_exportz7__internal__.distribute.strategy_supports_no_merge_call)v1c                      t        j                         syt        j                         } | j                  j	                          S )zFReturns if the current `Strategy` can operate in pure replica context.T)r   has_strategyget_strategyextended_use_merge_call)strategys    _/home/dcms/DCMS/lib/python3.12/site-packages/tensorflow/python/distribute/merge_call_interim.pystrategy_supports_no_merge_callr      s9     
	$	$	&((*(..0	00    z0__internal__.distribute.interim.maybe_merge_callc                 z    t               r | |g|i |S t        j                         j                  | ||      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   get_replica_context
merge_call)fnr   r   r   s       r   maybe_merge_callr      sG    * %&h((((--/::
f ; & &r   N)__doc__tensorflow.python.distributer    tensorflow.python.util.tf_exportr   r   r    r   r   <module>r      sJ    < 7 6 DL1 M1 ="E& F&r   