docstr: Loads a model saved via `estimator.save()
  
  :param filepath: (str) Path of saved model.
  :param custom_objects: Optional dictionary mapping names
    (strings) to custom classes or functions to be
    considered during deserialization.
  :param compile: Boolean, whether to compile the model after loading.
  :param options: Optional `tf.saved_model.LoadOptions` object that specifies
  options for loading from SavedModel.
docstr_tok: ["Loads","a","model","saved","via","`","estimator.save","(",")",":","param","filepath",":","(","str",")","Path","of","saved","model",".",":","param","custom_objects",":","Optional","dictionary","mapping","names","(","strings",")","to","custom","classes","or","functions","to","be","considered","during","deserialization",".",":","param","compile",":","Boolean",",","whether","to","compile","the","model","after","loading",".",":","param","options",":","Optional","`","tf.saved_model.LoadOptions","`","object","that","specifies","options","for","loading","from","SavedModel","."]
code: def load(
      self,
      filepath: str,
      custom_objects: Optional[Dict] = None,
      compile: bool = True,
  ) -> None:
      """
      Loads a model saved via `estimator.save()
  
      :param filepath: (str) Path of saved model.
      :param custom_objects: Optional dictionary mapping names
        (strings) to custom classes or functions to be
        considered during deserialization.
      :param compile: Boolean, whether to compile the model after loading.
      :param options: Optional `tf.saved_model.LoadOptions` object that specifies
      options for loading from SavedModel.
  
      """
      sc = OrcaContext.get_spark_context()
      self.load_params = dict(  # type:ignore
          filepath=filepath,
          custom_objects=custom_objects,
          compile=compile,
      )
      model = load_model(**self.load_params)  # type:ignore
      self.model_weights = model.get_weights()
      if model.optimizer is not None:
          if hasattr(model.optimizer, "get_weights"):
              self.optimizer_weights = model.optimizer.get_weights()
          else:
              self.optimizer_weights = [  # type:ignore
                  var.numpy() for var in model.optimizer.variables()
              ]  # type:ignore
      if self.model_creator is None:
          self.load_path = filepath  # type:ignore
          if is_file(self.load_path):  # type:ignore
              sc.addFile(self.load_path, recursive=False)
          else:
              sc.addFile(self.load_path, recursive=True)
      # update remote model
      if self.model_dir is not None:
          save_model(
              model,
              self._model_saved_path,
              save_format="h5",
              filemode=0o666,
          )
  
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 9 for calling the SparkTFEstimator obj's underlying member method code with example usage: obj.load(filepath, custom_objects, compile) without return types