code: def average_frame_initializer():
      """Initialisation function for 3D convolutional kernels.
  
      The filter is initialised such that it applies the same weights on each
      frame of the input.
      This is similar to "filter inflation" in
        "Joao Carreira, and Andrew Zisserman.
         Quo vadis, action recognition? a new model and the kinetics dataset".
      However, "filter inflation" uses the filter weights from a pretrained 2D CNN,
      and replicates them over all time dimensions.
  
      Returns:
        init: Initialisation function for Flax
      """
  
      def init(key, shape, dtype=jnp.float32):
          logging.info("Initialising shape %s", shape)
          assert len(shape) == 5, (
              "Should be initialising 5-d kernels"
              "(t, h, w, c_in, c_out"
          )
          assert shape[0] > 1, "Temporal dimension should be > 1"
  
          # Tiling the temporal dimension of a larger kernel ensures that the
          # normalisation is handled by default_kernel_init().
          init_kernel = linear.default_kernel_init(key, shape, dtype)
          init_kernel = jnp.tile(
              init_kernel[0:1, :, :, :, :],
              [init_kernel.shape[0], 1, 1, 1, 1],
          )
  
          return init_kernel
  
      return init
  
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 5 for calling a global function with example usage: average_frame_initializer() and returns: init, init_kernel