# Path: tensorflow_transform/tf2_utils.py
# def use_tf_compat_v1(force_tf_compat_v1: bool) -> bool:
# def strip_and_get_tensors_and_control_dependencies(
#     flat_tensor_list: Iterable[tf.Tensor]
# ) -> Tuple[Iterable[tf.Tensor], Iterable[tf.Operation]]:
# def supply_missing_tensor(batch_size: int, tensor_shape: tf.TensorShape,
#                           tensor_dtype: tf.DType) -> tf.Tensor:
# def supply_missing_inputs(
#     structured_inputs: Mapping[str, common_types.TensorType],
#     batch_size: int,
#     missing_keys: Optional[Collection[str]] = None
# ) -> Mapping[str, common_types.TensorType]:
# def get_structured_inputs_from_func_graph(
#     func_graph: FuncGraph) -> Mapping[str, common_types.TensorType]:
# 
# Path: tensorflow_transform/test_case.py
# def is_tf_api_version_1():
# def cross_named_parameters(*args):
#   def _cross_test_cases(parameters_list):
# def parameters(*testcases):
#   def wrapper(fn):
#     def to_arg_dict(testcase):
# def cross_parameters(*args):
# def _make_placeholder(tensor_spec):
# def _graph_function_handler(input_signature):
#   def wrapper(fn):
#     def _run_graph(*inputs):
# def _ragged_value_as_constant(value, dtype):
# def _wrap_as_constant(value, tensor_spec):
# def _eager_function_handler(input_signature):
#   def wrapper(fn):
#     def _run_eagerly(*inputs):  # pylint: disable=missing-docstring
# def _tf_function_function_handler(input_signature):
#   def wrapper(fn):
# def is_external_environment():
# def skip_if_external_environment(reason):
# def skip_if_not_tf2(reason):
# def cross_with_function_handlers(parameters_list):
#   def assertDataCloseOrEqual(self, a_data, b_data):
#   def _assertValuesCloseOrEqual(self, a_value, b_value, msg=None):
#   def AssertVocabularyContents(self, vocab_file_path, file_contents):
#   def WriteRenderedDotFile(self, dot_string, output_file=None):
#   def _NumpyArraysToLists(self, maybe_arrays):
#   def _SortedDicts(self, list_of_dicts):
#   def _SortedData(self, list_of_dicts_of_arrays):
# FUNCTION_HANDLERS = [
#     dict(testcase_name='graph',
#          function_handler=_graph_function_handler),
#     dict(testcase_name='eager',
#          function_handler=_eager_function_handler),
#     dict(testcase_name='tf_function',
#          function_handler=_tf_function_function_handler)
# ]
# class TransformTestCase(parameterized.TestCase, tf.test.TestCase):


import itertools
import tensorflow as tf
from tensorflow_transform import tf2_utils
from tensorflow_transform import test_case
# See the License for the specific language governing permissions and
# limitations under the License.
"""Tests for tensorflow_transform.tf2_utils."""


_TEST_BATCH_SIZES = [1, 10]
_TEST_DTYPES = [
    tf.int16,
    tf.int32,
    tf.int64,
    tf.float32,
    tf.float64,
    tf.string,
]

_TEST_TENSORS_TYPES = [
    (lambda dtype: tf.TensorSpec([None], dtype=dtype), tf.Tensor, []),
    (lambda dtype: tf.TensorSpec([None, 2], dtype=dtype), tf.Tensor, [2]),
    (lambda dtype: tf.RaggedTensorSpec([None, None], dtype=dtype),
     tf.RaggedTensor, [None]),
    (
        lambda dtype: tf.RaggedTensorSpec(  # pylint: disable=g-long-lambda
            [None, None, 2],
            dtype=dtype,
            ragged_rank=1),
        tf.RaggedTensor,
        [None, 2]),
]



# Path: tensorflow_transform/tf2_utils.py
# def use_tf_compat_v1(force_tf_compat_v1: bool) -> bool:
# def strip_and_get_tensors_and_control_dependencies(
#     flat_tensor_list: Iterable[tf.Tensor]
# ) -> Tuple[Iterable[tf.Tensor], Iterable[tf.Operation]]:
# def supply_missing_tensor(batch_size: int, tensor_shape: tf.TensorShape,
#                           tensor_dtype: tf.DType) -> tf.Tensor:
# def supply_missing_inputs(
#     structured_inputs: Mapping[str, common_types.TensorType],
#     batch_size: int,
#     missing_keys: Optional[Collection[str]] = None
# ) -> Mapping[str, common_types.TensorType]:
# def get_structured_inputs_from_func_graph(
#     func_graph: FuncGraph) -> Mapping[str, common_types.TensorType]:
# 
# Path: tensorflow_transform/test_case.py
# def is_tf_api_version_1():
# def cross_named_parameters(*args):
#   def _cross_test_cases(parameters_list):
# def parameters(*testcases):
#   def wrapper(fn):
#     def to_arg_dict(testcase):
# def cross_parameters(*args):
# def _make_placeholder(tensor_spec):
# def _graph_function_handler(input_signature):
#   def wrapper(fn):
#     def _run_graph(*inputs):
# def _ragged_value_as_constant(value, dtype):
# def _wrap_as_constant(value, tensor_spec):
# def _eager_function_handler(input_signature):
#   def wrapper(fn):
#     def _run_eagerly(*inputs):  # pylint: disable=missing-docstring
# def _tf_function_function_handler(input_signature):
#   def wrapper(fn):
# def is_external_environment():
# def skip_if_external_environment(reason):
# def skip_if_not_tf2(reason):
# def cross_with_function_handlers(parameters_list):
#   def assertDataCloseOrEqual(self, a_data, b_data):
#   def _assertValuesCloseOrEqual(self, a_value, b_value, msg=None):
#   def AssertVocabularyContents(self, vocab_file_path, file_contents):
#   def WriteRenderedDotFile(self, dot_string, output_file=None):
#   def _NumpyArraysToLists(self, maybe_arrays):
#   def _SortedDicts(self, list_of_dicts):
#   def _SortedData(self, list_of_dicts_of_arrays):
# FUNCTION_HANDLERS = [
#     dict(testcase_name='graph',
#          function_handler=_graph_function_handler),
#     dict(testcase_name='eager',
#          function_handler=_eager_function_handler),
#     dict(testcase_name='tf_function',
#          function_handler=_tf_function_function_handler)
# ]
# class TransformTestCase(parameterized.TestCase, tf.test.TestCase):


# Path: tensorflow_transform/tf2_utils_test.py
import itertools
import tensorflow as tf
from tensorflow_transform import tf2_utils
from tensorflow_transform import test_case

# See the License for the specific language governing permissions and
# limitations under the License.
"""Tests for tensorflow_transform.tf2_utils."""


_TEST_BATCH_SIZES = [1, 10]
_TEST_DTYPES = [
    tf.int16,
    tf.int32,
    tf.int64,
    tf.float32,
    tf.float64,
    tf.string,
]

_TEST_TENSORS_TYPES = [
    (lambda dtype: tf.TensorSpec([None], dtype=dtype), tf.Tensor, []),
    (lambda dtype: tf.TensorSpec([None, 2], dtype=dtype), tf.Tensor, [2]),
    (lambda dtype: tf.RaggedTensorSpec([None, None], dtype=dtype),
     tf.RaggedTensor, [None]),
    (
        lambda dtype: tf.RaggedTensorSpec(  # pylint: disable=g-long-lambda
            [None, None, 2],
            dtype=dtype,
            ragged_rank=1),
        tf.RaggedTensor,
        [None, 2]),
]



class TF2UtilsTest(test_case.TransformTestCase):