class_docstr: Bottleneck Block for a ResNet implementation.
class_docstr_tok: ["Bottleneck","Block","for","a","ResNet","implementation","."]
code: def __init__(
      self,
      channels: int,
      stride: Union[int, Sequence[int]],
      use_projection: bool,
      bn_config: Mapping[str, float],
      name: Optional[str] = None,
  ):
      super().__init__(name=name)
      self._channels = channels
      self._stride = stride
      self._use_projection = use_projection
      self._bn_config = bn_config
  
      batchnorm_args = {"create_scale": True, "create_offset": True}
      batchnorm_args.update(bn_config)
  
      if self._use_projection:
          self._proj_conv = conv.Conv2D(
              output_channels=channels,
              kernel_shape=1,
              stride=stride,
              with_bias=False,
              padding=pad.same,
              name="shortcut_conv",
          )
          self._proj_batchnorm = batch_norm.BatchNorm(
              name="shortcut_batchnorm", **batchnorm_args
          )
  
      self._layers = []
      conv_0 = conv.Conv2D(
          output_channels=channels // 4,
          kernel_shape=1,
          stride=1,
          with_bias=False,
          padding=pad.same,
          name="conv_0",
      )
      self._layers.append(
          [
              conv_0,
              batch_norm.BatchNorm(
                  name="batchnorm_0", **batchnorm_args
              ),
          ]
      )
  
      conv_1 = conv.Conv2D(
          output_channels=channels // 4,
          kernel_shape=3,
          stride=stride,
          with_bias=False,
          padding=pad.same,
          name="conv_1",
      )
      self._layers.append(
          [
              conv_1,
              batch_norm.BatchNorm(
                  name="batchnorm_1", **batchnorm_args
              ),
          ]
      )
  
      conv_2 = conv.Conv2D(
          output_channels=channels,
          kernel_shape=1,
          stride=1,
          with_bias=False,
          padding=pad.same,
          name="conv_2",
      )
      batchnorm_2 = batch_norm.BatchNorm(
          name="batchnorm_2",
          scale_init=initializers.Zeros(),
          **batchnorm_args,
      )
      self._layers.append([conv_2, batchnorm_2])
  
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 BottleNeckBlockV1 object from inherited base classes: base with example: obj = BottleNeckBlockV1(channels, stride, use_projection, bn_config, name)