code: def resnet_v2(
      inputs,
      block_fn,
      layer_blocks,
      filters,
      data_format="channels_first",
      is_training=False,
      is_cifar=False,
      use_td=False,
      targeting_rate=None,
      keep_prob=None,
      bottleneck_ratios=None,
  ):
      """Resnet model.
  
      Args:
        inputs: `Tensor` images.
        block_fn: `function` for the block to use within the model. Either
            `residual_block` or `bottleneck_block`.
        layer_blocks: list of 3 or 4 `int`s denoting the number of blocks to include
          in each of the 3 or 4 block groups. Each group consists of blocks that
          take inputs of the same resolution.
        filters: list of 4 or 5 `int`s denoting the number of filter to include in
          block.
        data_format: `str`, "channels_first" `[batch, channels, height,
            width]` or "channels_last" `[batch, height, width, channels]`.
        is_training: bool, build in training mode or not.
        is_cifar: bool, whether the data is CIFAR or not.
        use_td: `str` one of "weight" or "unit". Set to False or "" to disable
          targeted dropout.
        targeting_rate: `float` proportion of weights to target with targeted
          dropout.
        keep_prob: `float` keep probability for targeted dropout.
        bottleneck_ratios: list of `int`s, how much we scale up filters in
          bottleneck blocks.
  
      Returns:
        Pre-logit activations.
      """
      inputs = block_layer(
          inputs=inputs,
          filters=filters[1],
          block_fn=block_fn,
          blocks=layer_blocks[0],
          strides=1,
          is_training=is_training,
          name="block_layer1",
          data_format=data_format,
          use_td=use_td,
          targeting_rate=targeting_rate,
          keep_prob=keep_prob,
          bottleneck_ratio=bottleneck_ratios[0],
      )
      inputs = block_layer(
          inputs=inputs,
          filters=filters[2],
          block_fn=block_fn,
          blocks=layer_blocks[1],
          strides=2,
          is_training=is_training,
          name="block_layer2",
          data_format=data_format,
          use_td=use_td,
          targeting_rate=targeting_rate,
          keep_prob=keep_prob,
          bottleneck_ratio=bottleneck_ratios[1],
      )
      inputs = block_layer(
          inputs=inputs,
          filters=filters[3],
          block_fn=block_fn,
          blocks=layer_blocks[2],
          strides=2,
          is_training=is_training,
          name="block_layer3",
          data_format=data_format,
          use_td=use_td,
          targeting_rate=targeting_rate,
          keep_prob=keep_prob,
          bottleneck_ratio=bottleneck_ratios[2],
      )
      if not is_cifar:
          inputs = block_layer(
              inputs=inputs,
              filters=filters[4],
              block_fn=block_fn,
              blocks=layer_blocks[3],
              strides=2,
              is_training=is_training,
              name="block_layer4",
              data_format=data_format,
              use_td=use_td,
              targeting_rate=targeting_rate,
              keep_prob=keep_prob,
              bottleneck_ratio=bottleneck_ratios[3],
          )
  
      return inputs
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from tensor2tensor.layers import common_hparams
  from tensor2tensor.layers import common_layers
  from tensor2tensor.utils import hparam
  from tensor2tensor.utils import registry
  from tensor2tensor.utils import t2t_model
  import tensorflow.compat.v1
  from tensorflow.compat.v1 import estimator
label_desc: Use image node_id 8 for calling a global function with example usage: resnet_v2(inputs, block_fn, layer_blocks, filters, data_format, is_training, is_cifar, use_td, targeting_rate, keep_prob, bottleneck_ratios) and returns: inputs