code: def save_weights_only(model, filepath):
      """Save only the weights of a model to a target filepath (.weights.h5).
  
      Note: only supports h5 for now.
      """
      # TODO: if h5 filepath is remote, create the file in a temporary directory
      # then upload it
      filepath = str(filepath)
      if not filepath.endswith(".weights.h5"):
          raise ValueError(
              "Invalid `filepath` argument: expected a `.weights.h5` extension. "
              f"Received: filepath={filepath}"
          )
      weights_store = H5IOStore(filepath, mode="w")
      _save_state(
          model,
          weights_store=weights_store,
          assets_store=None,
          inner_path="",
          visited_trackables=set(),
      )
      weights_store.close()
  
imports: import datetime
  import io
  import json
  import tempfile
  import warnings
  import zipfile
  import numpy
  from keras.backend.common import global_state
  from keras.layers.layer import Layer
  from keras.losses.loss import Loss
  from keras.metrics.metric import Metric
  from keras.optimizers.optimizer import Optimizer
  from keras.saving.serialization_lib import ObjectSharingScope
  from keras.saving.serialization_lib import deserialize_keras_object
  from keras.saving.serialization_lib import serialize_keras_object
  from keras.trainers.compile_utils import CompileMetrics
  from keras.utils import file_utils
  from keras.utils import naming
  from keras.version import __version__
label_desc: Use image node_id 3 for calling a global function with example usage: save_weights_only(model, filepath) without return types