class_docstr: ResNetV1 based on big_vision/models/bit.py.
  
  This variant makes the root_block optional.
  
  Attributes:
    num_classes: Number of output channels for final projection. If set to zero,
      no final projection will be done.
    width: Width multiplier for the ResNet.
    depth: Sequence of ints specifying depth of each stage, or int specifying
      one of the standard ResNet depths.
    root_block: Whether to apply the root block or not.
class_docstr_tok: ["ResNetV1","based","on","big_vision\/models\/bit.py",".","This","variant","makes","the","root_block","optional",".","Attributes",":","num_classes",":","Number","of","output","channels","for","final","projection",".","If","set","to","zero",",","no","final","projection","will","be","done",".","width",":","Width","multiplier","for","the","ResNet",".","depth",":","Sequence","of","ints","specifying","depth","of","each","stage",",","or","int","specifying","one","of","the","standard","ResNet","depths",".","root_block",":","Whether","to","apply","the","root","block","or","not","."]
code: def __call__(self, inputs, *, train=False):
      del train  # Unused
      blocks = bit.get_block_desc(self.depth)
      width = int(64 * self.width)
  
      outs = {}
  
      # Root block.
      if self.root_block:
          convolved = bit.StdConv(
              width, (7, 7), (2, 2), use_bias=False, name="conv_root"
          )(inputs)
          normed = nn.GroupNorm(name="gn_root")(convolved)
          rectified = nn.relu(normed)
          pooled = nn.max_pool(
              rectified, (3, 3), strides=(2, 2), padding="SAME"
          )
          body_in = outs["stem"] = pooled
      else:
          body_in = inputs
  
      # Stages.
      activation = bit.ResNetStage(
          blocks[0], nmid=width, name="block1"
      )(body_in)
      outs["stage1"] = activation
      for i, block_size in enumerate(blocks[1:], 1):
          activation = bit.ResNetStage(
              block_size,
              nmid=width * 2**i,
              first_stride=(2, 2),
              name=f"block{i + 1}",
          )(activation)
          outs[f"stage{i + 1}"] = activation
      outs["pre_logits_2d"] = activation
  
      # Head.
      main_out = outs["pre_logits"] = jnp.mean(
          outs["pre_logits_2d"], axis=(1, 2)
      )
  
      if self.num_classes:
          head = nn.Dense(
              self.num_classes,
              name="head",
              kernel_init=nn.initializers.zeros,
          )
          outs["logits_2d"] = head(outs["pre_logits_2d"])
          main_out = outs["logits"] = head(outs["pre_logits"])
  
      return main_out, outs
  
imports: import abc
  import functools
  from typing import Any, Callable, Dict, Optional, Tuple, Union, Sequence
  from absl import logging
  from big_vision.models import bit
  from big_vision.models import vit
  import flax
  import flax.linen
  import jax
  import jax.numpy
  import ml_collections
  import numpy
  from scenic.model_lib.base_models import box_utils
  from scenic.projects.owl_vit import utils
  from scenic.projects.owl_vit.clip import layers
  from scenic.projects.owl_vit.clip import model
label_desc: Use image node_id 1 for calling the ResNet obj's underlying member method code with example usage: obj.__call__(inputs) and returns: main_out,  outs