class_docstr: ResNet v2 block with optional bottleneck.
docstr: Creates ResNetV2Block instance.
  
  Args:
      nin: number of input filters.
      nout: number of output filters.
      stride: stride for 3x3 convolution and projection convolution in this block.
      use_projection: if True then include projection convolution into this block.
      bottleneck: if True then make bottleneck block.
      normalization_fn: module which used as normalization function.
      activation_fn: activation function.
docstr_tok: ["Creates","ResNetV2Block","instance",".","Args",":","nin",":","number","of","input","filters",".","nout",":","number","of","output","filters",".","stride",":","stride","for","3x3","convolution","and","projection","convolution","in","this","block",".","use_projection",":","if","True","then","include","projection","convolution","into","this","block",".","bottleneck",":","if","True","then","make","bottleneck","block",".","normalization_fn",":","module","which","used","as","normalization","function",".","activation_fn",":","activation","function","."]
code: def __init__(
      self,
      nin: int,
      nout: int,
      stride: Union[int, Sequence[int]],
      use_projection: bool,
      bottleneck: bool,
      normalization_fn: Callable[
          ..., objax.Module
      ] = objax.nn.BatchNorm2D,
      activation_fn: Callable[
          [JaxArray], JaxArray
      ] = objax.functional.relu,
  ):
      """Creates ResNetV2Block instance.
  
      Args:
          nin: number of input filters.
          nout: number of output filters.
          stride: stride for 3x3 convolution and projection convolution in this block.
          use_projection: if True then include projection convolution into this block.
          bottleneck: if True then make bottleneck block.
          normalization_fn: module which used as normalization function.
          activation_fn: activation function.
      """
      self.use_projection = use_projection
      self.activation_fn = activation_fn
      self.stride = stride
  
      if self.use_projection:
          self.proj_conv = Conv2D(
              nin, nout, 1, strides=stride, **conv_args(1, nout)
          )
  
      if bottleneck:
          self.norm_0 = normalization_fn(nin)
          self.conv_0 = Conv2D(
              nin, nout // 4, 1, strides=1, **conv_args(1, nout // 4)
          )
          self.norm_1 = normalization_fn(nout // 4)
          self.conv_1 = Conv2D(
              nout // 4,
              nout // 4,
              3,
              strides=stride,
              **conv_args(3, nout // 4, (1, 1)),
          )
          self.norm_2 = normalization_fn(nout // 4)
          self.conv_2 = Conv2D(
              nout // 4, nout, 1, strides=1, **conv_args(1, nout)
          )
          self.layers = (
              (self.norm_0, self.conv_0),
              (self.norm_1, self.conv_1),
              (self.norm_2, self.conv_2),
          )
      else:
          self.norm_0 = normalization_fn(nin)
          self.conv_0 = Conv2D(
              nin, nout, 3, strides=1, **conv_args(3, nout, (1, 1))
          )
          self.norm_1 = normalization_fn(nout)
          self.conv_1 = Conv2D(
              nout,
              nout,
              3,
              strides=stride,
              **conv_args(3, nout, (1, 1)),
          )
          self.layers = (
              (self.norm_0, self.conv_0),
              (self.norm_1, self.conv_1),
          )
  
imports: import functools
  from typing import Callable, Sequence, Union, Optional
  from jax import numpy
  import objax
  from objax.constants import ConvPadding
  from objax.nn import Conv2D
  from objax.typing import JaxArray, ConvPaddingInt
label_desc: Use image node_id 1 to create a new ResNetV2Block object from inherited base classes: objax with example: obj = ResNetV2Block(nin, nout, stride, use_projection, bottleneck, normalization_fn, activation_fn)