code: def test_save_model_tf(data, model, layer, tmp_path):
      """
      Unit test for _save_model_config and _load_model_config with tensorflow model.
      """
      # Save model
      filepath = tmp_path
      input_shape = (data[0].shape[1],)
      cfg_model, _ = _save_model_config(
          model, base_path=filepath, input_shape=input_shape
      )
      cfg_model = _path2str(cfg_model)
      cfg_model = ModelConfig(**cfg_model).dict()
      assert tmp_path.joinpath("model").is_dir()
      assert tmp_path.joinpath("model/model.h5").is_file()
  
      # Adjust config
      cfg_model["src"] = tmp_path.joinpath(
          "model"
      )  # Need to manually set to absolute path here
      if layer is not None:
          cfg_model["layer"] = layer
  
      # Load model
      model_load = _load_model_config(cfg_model)
      if layer is None:
          assert isinstance(model_load, type(model))
      else:
          assert isinstance(model_load, HiddenOutput_tf)
  
file_path: alibi-detect/alibi_detect/saving/_tensorflow/tests/test_saving_tf.py
imports: from pytest_cases import param_fixture, parametrize, parametrize_with_cases
  import pytest
  from alibi_detect.saving.tests.datasets import ContinuousData
  from alibi_detect.saving.tests.models import encoder_model
  from alibi_detect.cd.tensorflow import HiddenOutput
  from alibi_detect.saving.loading import _load_model_config, _load_optimizer_config
  from alibi_detect.saving.saving import _path2str, _save_model_config, _save_optimizer_config
  from alibi_detect.saving.schemas import ModelConfig, SupportedOptimizer
  import tensorflow
  import numpy
  from packaging import version
label_desc: Use image node_id 4 for calling a global function with example usage: test_save_model_tf(data, model, layer, tmp_path) without return types