docstr: Saves the model to Tensorflow SavedModel or a single HDF5 file.
  
  :param filepath: String, PathLike, path to SavedModel or H5 file to save the
      model. It can be local/hdfs/s3 filepath
  :param overwrite: Whether to silently overwrite any existing file at the
      target location, or provide the user with a manual prompt.
  :param include_optimizer: If True, save optimizer's state together.
  :param save_format: Either `'tf'` or `'h5'`, indicating whether to save the
      model to Tensorflow SavedModel or HDF5. Defaults to 'tf' in TF 2.X,
      and 'h5' in TF 1.X.
  :param signatures: Signatures to save with the SavedModel. Applicable to the
      'tf' format only. Please see the `signatures` argument in
      `tf.saved_model.save` for details.
  :param options: (only applies to SavedModel format)
      `tf.saved_model.SaveOptions` object that specifies options for
      saving to SavedModel.
docstr_tok: ["Saves","the","model","to","Tensorflow","SavedModel","or","a","single","HDF5","file",".",":","param","filepath",":","String",",","PathLike",",","path","to","SavedModel","or","H5","file","to","save","the","model",".","It","can","be","local\/hdfs\/s3","filepath",":","param","overwrite",":","Whether","to","silently","overwrite","any","existing","file","at","the","target","location",",","or","provide","the","user","with","a","manual","prompt",".",":","param","include_optimizer",":","If","True",",","save","optimizer","'s","state","together",".",":","param","save_format",":","Either","`","'tf","'","`","or","`","'h5","'","`",",","indicating","whether","to","save","the","model","to","Tensorflow","SavedModel","or","HDF5",".","Defaults","to","'tf","'","in","TF","2.X",",","and","'h5","'","in","TF","1.X",".",":","param","signatures",":","Signatures","to","save","with","the","SavedModel",".","Applicable","to","the","'tf","'","format","only",".","Please","see","the","`","signatures","`","argument","in","`","tf.saved_model.save","`","for","details",".",":","param","options",":","(","only","applies","to","SavedModel","format",")","`","tf.saved_model.SaveOptions","`","object","that","specifies","options","for","saving","to","SavedModel","."]
code: def save(
      self,
      filepath: str,
      overwrite: bool = True,
      include_optimizer: bool = True,
      save_format: Optional[str] = None,
      signatures: Optional[str] = None,
      options: Optional["SaveOptions"] = None,
  ) -> None:
      """
      Saves the model to Tensorflow SavedModel or a single HDF5 file.
  
      :param filepath: String, PathLike, path to SavedModel or H5 file to save the
          model. It can be local/hdfs/s3 filepath
      :param overwrite: Whether to silently overwrite any existing file at the
          target location, or provide the user with a manual prompt.
      :param include_optimizer: If True, save optimizer's state together.
      :param save_format: Either `'tf'` or `'h5'`, indicating whether to save the
          model to Tensorflow SavedModel or HDF5. Defaults to 'tf' in TF 2.X,
          and 'h5' in TF 1.X.
      :param signatures: Signatures to save with the SavedModel. Applicable to the
          'tf' format only. Please see the `signatures` argument in
          `tf.saved_model.save` for details.
      :param options: (only applies to SavedModel format)
          `tf.saved_model.SaveOptions` object that specifies options for
          saving to SavedModel.
      """
      # get current model
      if self.model_dir is not None and exists(self._model_saved_path):
          model = load_model(self._model_saved_path)
      else:
          model = self.get_model()
      # save model
      save_model(
          model,
          filepath,
          overwrite=overwrite,
          include_optimizer=include_optimizer,
          save_format=save_format,
          signatures=signatures,
          options=options,
      )
  
imports: import os
  import types
  import logging
  import tempfile
  import shutil
  from bigdl.dllib.utils.common import get_node_and_core_number
  from bigdl.dllib.utils.file_utils import is_local_path
  from bigdl.dllib.utils.utils import get_node_ip
  from bigdl.orca.data.file import is_file, exists, get_remote_file_to_local, get_remote_files_with_prefix_to_local, put_local_file_to_remote, put_local_files_with_prefix_to_remote
  from bigdl.orca.learn.tf2.spark_runner import SparkRunner
  from bigdl.orca.learn.utils import find_free_port, find_ip_and_free_port
  from bigdl.orca.learn.utils import maybe_dataframe_to_xshards, dataframe_to_xshards, convert_predict_xshards_to_dataframe, make_data_creator, load_model, save_model, process_xshards_of_pandas_dataframe, add_predict_to_pd_xshards, update_predict_xshards
  from bigdl.orca.learn.log_monitor import start_log_server, stop_log_server
  from bigdl.orca import OrcaContext
  from bigdl.orca.data.shard import SparkXShards
  from bigdl.dllib.utils.log4Error import invalidInputError
  from pyspark.sql.dataframe import DataFrame
  from typing import TYPE_CHECKING, Any, Dict, List, Callable, Union, Optional
label_desc: Use image node_id 8 for calling the SparkTFEstimator obj's underlying member method code with example usage: obj.save(filepath, overwrite, include_optimizer, save_format, signatures, options) without return types