code: def interpolate_1d_positional_embeddings(restored_posemb, n_tokens):
      """Interpolate one-dimensional positional embeddings.
  
      Used when the number of tokens at the input of the encoder is different
      between the pretrained and target models. This function is used for the
      temporal encoder in the Factorised Encoder model which has 1d positional
      embeddings.
  
      Args:
        restored_posemb: Positional embeddings from restored model. Shape is
          [n_restored_tokens, d].
        n_tokens: Number of tokens in the target model.
  
      Returns:
        positional embedding tiled to match n_tokens. Shape is [1, n_tokens, d].
      """
  
      zoom = (n_tokens / restored_posemb.shape[0], 1)
      logging.info("Interpolating embeddings by a factor of %s", zoom)
      restored_posemb = scipy.ndimage.zoom(
          restored_posemb, zoom, order=1
      )
      restored_posemb = np.expand_dims(restored_posemb, axis=0)
  
      return restored_posemb
  
imports: from typing import Any, Optional, Tuple
  from absl import logging
  import flax
  from flax.linen import linear
  from flax.training import common_utils
  import jax
  import jax.numpy
  import ml_collections
  import numpy
  from scenic.common_lib import debug_utils
  from scenic.model_lib.base_models import model_utils
  import scipy
label_desc: Use image node_id 8 for calling a global function with example usage: interpolate_1d_positional_embeddings(restored_posemb, n_tokens) and returns: restored_posemb