code: def interpolate_class_embedding(
      class_embedding: jnp.ndarray,
      restored_class_embedding: jnp.ndarray,
  ) -> jnp.ndarray:
      """Interpolates class embeddings.
  
      This function is used to initialize class embeddings for UnLoc models when
      the current model has a different number of class embeddings than the
      pretrained ones.
  
      Args:
        class_embedding: A 2D float tensor of shape (new_time, channels)
          representing the class embeddings to be updated.
        restored_class_embedding: A 2D float tensor of shape (old_time, channels)
          representing the class embeddings from which we load the weights.
  
      Returns:
        A 2D float tensor of shape (new_time, channels) representing the resized
        class embeddings.
      """
      logging.info(
          "Resizing class embeddings from %s to %s.",
          restored_class_embedding.shape,
          class_embedding.shape,
      )
      zoom = (
          class_embedding.shape[0] / restored_class_embedding.shape[0],
          1,
      )
      return scipy.ndimage.zoom(restored_class_embedding, zoom, order=1)
  
imports: import collections.abc
  import functools
  import re
  from typing import Any, Callable, Dict, Mapping, Optional, Sequence, Tuple, Union
  from absl import logging
  import flax
  import flax.linen
  import jax
  from jax.example_libraries.optimizers import clip_grads
  import jax.numpy
  import ml_collections
  import optax
  from scenic.common_lib import debug_utils
  from scenic.dataset_lib import dataset_utils
  from scenic.projects.baselines.clip import model
  from scenic.projects.unloc import eval_utils
  from scenic.projects.unloc import model_utils
  from scenic.projects.vivit import model_utils
  from scenic.train_lib import pretrain_utils
  from scenic.train_lib import train_utils
  import scipy.ndimage
label_desc: Use image node_id 2 for calling a global function with example usage: interpolate_class_embedding(class_embedding, restored_class_embedding) and returns: scipy