class_docstr: Bottleneck ResNet block.
  
  Attributes:
    nout: Number of output features.
    strides: Downsampling stride.
    dilation: Kernel dilation.
    bottleneck: If True, the block is a bottleneck block.
    gn_num_groups: Number of groups in GroupNorm layer.
class_docstr_tok: ["Bottleneck","ResNet","block",".","Attributes",":","nout",":","Number","of","output","features",".","strides",":","Downsampling","stride",".","dilation",":","Kernel","dilation",".","bottleneck",":","If","True",",","the","block","is","a","bottleneck","block",".","gn_num_groups",":","Number","of","groups","in","GroupNorm","layer","."]
code: def __call__(self, x: jnp.ndarray) -> jnp.ndarray:
      features = self.nout
      nout = self.nout * 4 if self.bottleneck else self.nout
      needs_projection = x.shape[-1] != nout or self.strides != (1, 1)
      residual = x
      if needs_projection:
          residual = StdConv(
              nout,
              (1, 1),
              self.strides,
              use_bias=False,
              name="conv_proj",
          )(residual)
          residual = nn.GroupNorm(
              num_groups=self.gn_num_groups,
              epsilon=1e-4,
              name="gn_proj",
          )(residual)
  
      if self.bottleneck:
          x = StdConv(features, (1, 1), use_bias=False, name="conv1")(x)
          x = nn.GroupNorm(
              num_groups=self.gn_num_groups, epsilon=1e-4, name="gn1"
          )(x)
          x = nn.relu(x)
  
      x = StdConv(
          features,
          (3, 3),
          self.strides,
          kernel_dilation=self.dilation,
          use_bias=False,
          name="conv2",
      )(x)
      x = nn.GroupNorm(
          num_groups=self.gn_num_groups, epsilon=1e-4, name="gn2"
      )(x)
      x = nn.relu(x)
  
      last_kernel = (1, 1) if self.bottleneck else (3, 3)
      x = StdConv(nout, last_kernel, use_bias=False, name="conv3")(x)
      x = nn.GroupNorm(
          num_groups=self.gn_num_groups,
          epsilon=1e-4,
          name="gn3",
          scale_init=nn.initializers.zeros,
      )(x)
      x = nn.relu(residual + x)
  
      return x
  
imports: from typing import Any, Dict, Optional, Sequence, Tuple, Union
  from absl import logging
  import flax
  import flax.linen
  import jax.numpy
  import ml_collections
  from scenic.common_lib import debug_utils
  from scenic.model_lib.base_models.classification_model import ClassificationModel
  from scenic.model_lib.base_models.multilabel_classification_model import MultiLabelClassificationModel
  from scenic.model_lib.layers import nn_layers
label_desc: Use image node_id 1 for calling the ResidualUnit obj's underlying member method code with example usage: obj.__call__(x) and returns: x