class_docstr: Manages a TensorFlow model for training.
docstr: Loads all layer weights from a remote weight file (Tensorflow or HDF5 format).
docstr_tok: ["Loads","all","layer","weights","from","a","remote","weight","file","(","Tensorflow","or","HDF5","format",")","."]
code: def load_remote_weights(
      self, filepath, by_name, skip_mismatch, options
  ):
      """Loads all layer weights from a remote weight file (Tensorflow or HDF5 format)."""
      file_name = os.path.basename(filepath)
      with tempfile.TemporaryDirectory() as temp_dir:
          if is_file(filepath):
              # h5 format
              temp_path = os.path.join(temp_dir, file_name)
              get_remote_file_to_local(filepath, temp_path)
          else:
              # tensorflow format
              prefix = os.path.basename(filepath)
              get_remote_files_with_prefix_to_local(filepath, temp_dir)
              temp_path = os.path.join(temp_dir, prefix)
          if options:
              self.model.load_weights(
                  temp_path, by_name, skip_mismatch, options
              )
          else:  # To support older TensorFlow versions such as 2.1
              self.model.load_weights(temp_path, by_name, skip_mismatch)
  
imports: import json
  import os
  import socket
  import shutil
  import tempfile
  import copy
  import ray
  from contextlib import closing
  from bigdl.dllib.utils import log4Error
  from bigdl.orca.data.utils import partitions_get_data_label, partitions_get_tf_dataset
  from bigdl.orca.data.file import is_file, get_remote_file_to_local, get_remote_dir_to_local, get_remote_files_with_prefix_to_local, put_local_file_to_remote, put_local_dir_tree_to_remote, put_local_files_with_prefix_to_remote
  from bigdl.orca.learn.utils import process_tensorboard_in_callbacks
  from bigdl.dllib.utils.log4Error import *
label_desc: Use image node_id 17 for calling the TFRunner obj's underlying member method code with example usage: obj.load_remote_weights(filepath, by_name, skip_mismatch, options) without return types