class_docstr: ResNeXt layer with `in_planes` input planes and `out_planes`
  output planes.
class_docstr_tok: ["ResNeXt","layer","with","`","in_planes","`","input","planes","and","`","out_planes","`","output","planes","."]
code: def __init__(
      self,
      in_planes,
      out_planes,
      stride=1,
      mid_planes_and_cardinality=None,
      reduction=1,
      final_bn_relu=True,
      use_se=False,
      se_reduction_ratio=16,
  ):
      # assertions on inputs:
      assert is_pos_int(in_planes) and is_pos_int(out_planes)
      assert (
          is_pos_int(stride) or is_pos_int_tuple(stride)
      ) and is_pos_int(reduction)
  
      # define convolutional block:
      convolutional_block = nn.Sequential(
          conv3x3(in_planes, out_planes, stride=stride),
          nn.BatchNorm2d(out_planes),
          nn.ReLU(inplace=INPLACE),
          conv3x3(out_planes, out_planes),
      )
  
      # call constructor of generic layer:
      super().__init__(
          convolutional_block,
          in_planes,
          out_planes,
          stride=stride,
          reduction=reduction,
          final_bn_relu=final_bn_relu,
          use_se=use_se,
          se_reduction_ratio=se_reduction_ratio,
      )
  
imports: import copy
  import math
  import re
  import warnings
  from collections import OrderedDict
  from typing import Any, Dict, Optional, Sequence
  import torch.nn
  from classy_vision.generic.util import is_pos_int, is_pos_int_tuple
  from .None import register_model
  from .classy_model import ClassyModel
  from .squeeze_and_excitation_layer import SqueezeAndExcitationLayer
label_desc: Use image node_id 1 to create a new BasicLayer object from inherited base classes: GenericLayer with example: obj = BasicLayer(in_planes, out_planes, stride, mid_planes_and_cardinality, reduction, final_bn_relu, use_se, se_reduction_ratio)