class_docstr: Higher level block for ResNet implementation.
class_docstr_tok: ["Higher","level","block","for","ResNet","implementation","."]
code: def __init__(
      self,
      channels: int,
      num_blocks: int,
      stride: Union[int, Sequence[int]],
      bn_config: Mapping[str, float],
      resnet_v2: bool = False,
      name: Optional[str] = None,
  ):
      super().__init__(name=name)
      self._channels = channels
      self._num_blocks = num_blocks
      self._stride = stride
      self._bn_config = bn_config
  
      if resnet_v2:
          bottle_neck_block = BottleNeckBlockV2
      else:
          bottle_neck_block = BottleNeckBlockV1
  
      self._blocks = []
      for id_block in range(num_blocks):
          self._blocks.append(
              bottle_neck_block(
                  channels=channels,
                  stride=stride if id_block == 0 else 1,
                  use_projection=(id_block == 0),
                  bn_config=bn_config,
                  name="block_%d" % (id_block),
              )
          )
  
imports: from typing import Mapping, Optional, Sequence, Union
  from sonnet.src import base
  from sonnet.src import batch_norm
  from sonnet.src import conv
  from sonnet.src import initializers
  from sonnet.src import linear
  from sonnet.src import pad
  import tensorflow
label_desc: Use image node_id 1 to create a new BlockGroup object from inherited base classes: base with example: obj = BlockGroup(channels, num_blocks, stride, bn_config, resnet_v2, name)