code: def get_spectogram_targets(
      inputs: jnp.ndarray,
      patch_size: Patch,
      standardise_per_patch: bool = False,
  ) -> jnp.ndarray:
      """Get spectogram targets to use for feature regression.
  
      Here, the targets are the raw spectogram patches of the image.
  
      Args:
        inputs: Tensor of shape [b, h, w, c].
        patch_size: The shape of the patch, defined as [ph, pw].
        standardise_per_patch: If true, standardise each patch by subtracting the
          mean and dividing by the standard deviation of that patch.
  
      Returns:
        Patched inputs. Shape is [b, gh * gw, ph * pw * c].
      """
      if inputs.ndim != 4:
          raise ValueError("Inputs should be 4D.")
  
      if inputs.ndim == 4:
          batch = inputs.shape[0]
          # Shape is [batch, ht, wt, hp, wp, c]
          patched_image = nn_ops.patch_image(
              inputs, inputs_shape=None, patch_size=patch_size
          )
          num_tokens = patched_image.shape[1] * patched_image.shape[2]
          patched_input = jnp.reshape(
              patched_image, (batch, num_tokens, -1)
          )
  
      if standardise_per_patch:
          patched_input = jax.nn.standardize(
              patched_input, axis=-1, epsilon=1e-6
          )
  
      return patched_input
  
file_path: scenic/scenic/projects/av_mae/base_model.py
imports: import functools
  from typing import Dict, Optional, Tuple, Union
  from immutabledict import immutabledict
  import jax
  import jax.numpy
  import numpy
  from scenic.model_lib.base_models import base_model
  from scenic.model_lib.base_models import model_utils
  from scenic.model_lib.base_models import regression_model
  from scenic.model_lib.layers import nn_ops
label_desc: Use image node_id 4 for calling a global function with example usage: get_spectogram_targets(inputs, patch_size, standardise_per_patch) and returns: patched_input