class_docstr: Bottleneck Block from `"Aggregated Residual Transformations for Deep Neural Networks"
  <http://arxiv.org/abs/1611.05431>`_ paper.
  
  Parameters
  ----------
  cardinality: int
      Number of groups
  bottleneck_width: int
      Width of bottleneck block
  stride : int
      Stride size.
  downsample : bool, default False
      Whether to downsample the input.
  norm_layer : object
      Normalization layer used (default: :class:`mxnet.gluon.nn.BatchNorm`)
      Can be :class:`mxnet.gluon.nn.BatchNorm` or :class:`mxnet.gluon.contrib.nn.SyncBatchNorm`.
  norm_kwargs : dict
      Additional `norm_layer` arguments, for example `num_devices=4`
      for :class:`mxnet.gluon.contrib.nn.SyncBatchNorm`.
class_docstr_tok: ["Bottleneck","Block","from","`","``","Aggregated","Residual","Transformations","for","Deep","Neural","Networks","''","<","http",":","\/\/arxiv.org\/abs\/1611.05431",">","`","_","paper",".","Parameters","--","--","--","--","--","cardinality",":","int","Number","of","groups","bottleneck_width",":","int","Width","of","bottleneck","block","stride",":","int","Stride","size",".","downsample",":","bool",",","default","False","Whether","to","downsample","the","input",".","norm_layer",":","object","Normalization","layer","used","(","default",":",":","class",":","`","mxnet.gluon.nn.BatchNorm","`",")","Can","be",":","class",":","`","mxnet.gluon.nn.BatchNorm","`","or",":","class",":","`","mxnet.gluon.contrib.nn.SyncBatchNorm","`",".","norm_kwargs",":","dict","Additional","`","norm_layer","`","arguments",",","for","example","`","num_devices=4","`","for",":","class",":","`","mxnet.gluon.contrib.nn.SyncBatchNorm","`","."]
code: def __init__(
      self,
      channels,
      cardinality,
      bottleneck_width,
      stride,
      downsample=False,
      norm_layer=BatchNorm,
      norm_kwargs=None,
      **kwargs,
  ):
      super(CIFARBlock, self).__init__(**kwargs)
      D = int(math.floor(channels * (bottleneck_width / 64)))
      group_width = cardinality * D
  
      self.body = nn.HybridSequential(prefix="")
      self.body.add(
          nn.Conv2D(group_width, kernel_size=1, use_bias=False)
      )
      self.body.add(
          norm_layer(**({} if norm_kwargs is None else norm_kwargs))
      )
      self.body.add(nn.Activation("relu"))
      self.body.add(
          nn.Conv2D(
              group_width,
              kernel_size=3,
              strides=stride,
              padding=1,
              groups=cardinality,
              use_bias=False,
          )
      )
      self.body.add(
          norm_layer(**({} if norm_kwargs is None else norm_kwargs))
      )
      self.body.add(nn.Activation("relu"))
      self.body.add(
          nn.Conv2D(channels * 4, kernel_size=1, use_bias=False)
      )
      self.body.add(
          norm_layer(**({} if norm_kwargs is None else norm_kwargs))
      )
  
      if downsample:
          self.downsample = nn.HybridSequential(prefix="")
          self.downsample.add(
              nn.Conv2D(
                  channels * 4,
                  kernel_size=1,
                  strides=stride,
                  use_bias=False,
              )
          )
          self.downsample.add(
              norm_layer(**({} if norm_kwargs is None else norm_kwargs))
          )
      else:
          self.downsample = None
  
file_path: gluon-cv/gluoncv/model_zoo/cifarresnext.py
imports: from __future__ import division
  import os
  import math
  from mxnet import cpu
  from mxnet.gluon import nn
  from mxnet.gluon.nn import BatchNorm
  from mxnet.gluon.block import HybridBlock
label_desc: Use image node_id 1 to create a new CIFARBlock object from inherited base classes: HybridBlock with example: obj = CIFARBlock(channels, cardinality, bottleneck_width, stride, downsample, norm_layer, norm_kwargs)