code: def initialize_from_mtv_parameters(
      config: ml_collections.ConfigDict,
      params: Dict[str, Any],
      restored_model_cfg: ml_collections.ConfigDict,
      restored_params: Dict[str, Any],
      restore_output_projection: bool,
      model_prefix_path: Optional[List[str]] = None,
  ):
      """Initialize MTV parameters from a MTV model.
  
      Args:
        config: Configuration for the model being updated.
        params: The parameters of the model.
        restored_model_cfg: Configuration of the model from which the
          restored_train_state come from. Usually used for some asserts.
        restored_params: Restored parameters from the given pretrained checkpoint.
        restore_output_projection: Whether or not to restore the weights from output
          projection.
        model_prefix_path: The parent keys in the model dict where the restored
          model should reside.
      """
      if model_prefix_path:
          to_params = params[model_prefix_path[0]]
          for prefix in model_prefix_path[1:]:
              to_params = to_params[prefix]
      else:
          to_params = params
      for m_key, m_params in restored_params.items():
          if m_key == "output_projection":
              if restore_output_projection:
                  to_params[m_key] = m_params
          elif m_key == _BOTTLENECK_KEY:
              init_bottleneck(to_params, m_params)
          elif "cls" in m_key:
              if config.model.classifier != "token":
                  logging.info(
                      "Skipping %s since classifier != `token`.", m_key
                  )
                  continue
              if to_params[m_key].shape[1] != m_params.shape[1]:
                  to_params[m_key] = interpolate_cls_tokens(
                      to_params[m_key], m_params
                  )
              else:
                  to_params[m_key] = m_params
          elif "embedding" in m_key:
              if (
                  to_params[m_key]["kernel"].shape
                  != m_params["kernel"].shape
              ):
                  interpolate_input_embedding(
                      to_params[m_key], m_params
                  )
              else:
                  to_params[m_key] = m_params
          elif m_key == "global_encoder":
              for ge_key, ge_params in m_params.items():
                  if (
                      "posembed_input" in ge_key
                  ):  # Might need resolution change
                      vivit_utils.init_posemb(
                          to_params[m_key],
                          m_params,
                          config,
                          restored_model_cfg,
                          is_temporal=True,
                      )
                  else:
                      to_params[m_key][ge_key] = ge_params
          elif m_key == "MultiviewEncoder":
              for tm_key, tm_params in m_params.items():
                  if (
                      "posembed_input" in tm_key
                  ):  # Might need resolution change
                      vivit_utils.init_posemb(
                          to_params["MultiviewEncoder"],
                          m_params,
                          config,
                          restored_model_cfg,
                          is_temporal=False,
                          posemb_name=tm_key,
                          restored_posemb_name=tm_key,
                      )
                  else:
                      to_params[m_key][tm_key] = tm_params
          else:
              to_params[m_key] = m_params
  
imports: from typing import Any, Dict, List, Optional, Sequence
  from absl import logging
  import flax
  import jax.numpy
  import ml_collections
  import numpy
  from scenic.projects.vivit import model_utils
  from scenic.train_lib import train_utils
  import scipy.ndimage
label_desc: Use image node_id 8 for calling a global function with example usage: initialize_from_mtv_parameters(config, params, restored_model_cfg, restored_params, restore_output_projection, model_prefix_path) without return types