class_docstr: Image encoder.
class_docstr_tok: ["Image","encoder","."]
code: def encode_video(
      self,
      video: jnp.ndarray,  # Shape: (N, F, H, W, C)
      *,
      train: bool = False,
      debug: bool = False,
  ) -> jnp.ndarray:  # Shape: (N, E)
      images = video.reshape(-1, *video.shape[-3:])
      encoded_images = self(images, train=train, debug=debug)
      encoded_video = encoded_images.reshape(*video.shape[:-3], -1)
      # Averaging representations is the same as averaging predictions:
      # <t, (i1+i2)/2> = 1/2 <t, i1+i2> = (<t, i1> + <t, i2>) / 2
      # (for dot product).
      return encoded_video.mean(axis=-2)
  
imports: import abc
  from typing import Literal
  from typing import Optional
  import flax
  from flax.core.frozen_dict import FrozenDict
  import flax.linen
  import jax
  import jax.numpy
label_desc: Use image node_id 2 for calling the ImageEncoder obj's underlying member method code with example usage: obj.encode_video(video) and returns: encoded_video