class_docstr: Transformer feature pyramid encoder.
  
  Attributes:
    num_layers: Number of layers.
    mlp_dim: Dimension of the mlp on top of attention block.
    num_heads: Number of attention heads.
    feature_pyramid_config: Feature pyramid config.
    downsample_strategy: Strategy to downsample video tokens. Options are:
      'subsample', 'avg_pool', or 'max_pool'.
    positional_embedding: 'learned', 'sinusoid', or 'none'.
    positional_embedding_max_length: If set, the positional embeddings/encodings
      are applied to the first N elements in the input sequence. If not set, the
      positional embeddings/encodings are added to the entire input sequence.
    dropout_rate: Dropout rate.
    stochastic_depth: probability of dropping a layer linearly grows from 0 to
      the provided value. Our implementation of stochastic depth follows the
      timm library, which does per-example layer dropping and uses independent
      dropping patterns for each skip-connection.
    window_size: Window size for window attention blocks.
    window_block_indexes: Tuple. Indexes for blocks using window attention.
    dtype: Dtype of activations.
code: def _max_pool(self, x: jnp.ndarray) -> jnp.ndarray:
      stride = (
          self.feature_pyramid_config.feature_pyramid_downsample_stride
      )
      return nn.max_pool(x, window_shape=(stride,), strides=(stride,))
  
imports: import functools
  from typing import Callable, List, Optional, Sequence, Tuple
  from absl import logging
  import flax.linen
  import jax
  import jax.numpy
  import ml_collections
  import numpy
  from scenic.model_lib.layers import attention_layers
  from scenic.projects.baselines import vit
  from scenic.projects.unloc import encoders
  from scenic.projects.unloc import model_utils
label_desc: Use image node_id 3 for calling the FeaturePyramidEncoder obj's underlying member method code with example usage: obj._max_pool(x) and returns: nn