o
    ?e                     @   s   d Z ddlZddlmZ ddlmZ ddlmZ ddlmZ ddl	m
Z
 G dd	 d	ejZG d
d dejZejeje e fdZejZejZejZe
dg de dS )zThis module customizes `test_combinations` for Tensorflow.

Additionally it provides `generate()`, `combine()` and `times()` with Tensorflow
customizations as a default.
    N)tf2)context)ops)test_combinations)	tf_exportc                   @       e Zd ZdZdd Zdd ZdS )EagerGraphCombinationzRun the test in Graph or Eager mode.

  The optional `mode` parameter controls the test's execution mode.  Its
  accepted values are "graph" or "eager" literals.
  c                 C   sV   | dd }|d u rg S |dkrt gS |dkr#t  t gS td| d)Nmodeeagergraphz=Argument 'mode' must be either 'eager' or 'graph'. Received: .)popr   Z
eager_moder   ZGraphZ
as_defaultZ
graph_mode
ValueError)selfkwargsr	    r   i/home/www/facesmatcher.com/pyenv/lib/python3.10/site-packages/tensorflow/python/framework/combinations.pycontext_managers%   s   
z&EagerGraphCombination.context_managersc                 C      t dgS )Nr	   r   ZOptionalParameterr   r   r   r   parameter_modifiers2      z)EagerGraphCombination.parameter_modifiersN)__name__
__module____qualname____doc__r   r   r   r   r   r   r      s    r   c                   @   r   )TFVersionCombinationa*  Control the execution of the test in TF1.x and TF2.

  If TF2 is enabled then a test with TF1 test is going to be skipped and vice
  versa.

  Test targets continuously run in TF2 thanks to the tensorflow.v2 TAP target.
  A test can be run in TF2 with bazel by passing --test_env=TF2_BEHAVIOR=1.
  c                 C   s8   | dd }|dkrt rdS |dkrt sdS dS )Ntf_api_version   )Fz*Skipping a TF1.x test when TF2 is enabled.   )Fz,Skipping a TF2 test when TF2 is not enabled.)TN)r   r   enabled)r   r   r   r   r   r   should_execute_combination@   s   z/TFVersionCombination.should_execute_combinationc                 C   r   )Nr   r   r   r   r   r   r   H   r   z(TFVersionCombination.parameter_modifiersN)r   r   r   r   r"   r   r   r   r   r   r   6   s    	r   z'__internal__.test.combinations.generate)v1)r   	functoolsZtensorflow.pythonr   Ztensorflow.python.eagerr   Ztensorflow.python.frameworkr   r   Z tensorflow.python.util.tf_exportr   ZTestCombinationr   r   partialgeneratecombinetimesZNamedObjectr   r   r   r   <module>   s"   
