docstr: Affine transformation to replace BN in networks where BN cannot be
  used (e.g., because the minibatch size is too small).
  
  The operations can be done in place to save memory.
docstr_tok: ["Affine","transformation","to","replace","BN","in","networks","where","BN","can","not","be","used","(","e.g.",",","because","the","minibatch","size","is","too","small",")",".","The","operations","can","be","done","in","place","to","save","memory","."]
code: def AffineChannel(self, blob_in, blob_out, dim, inplace=False):
      """Affine transformation to replace BN in networks where BN cannot be
      used (e.g., because the minibatch size is too small).
  
      The operations can be done in place to save memory.
      """
      blob_out = blob_out or self.net.NextName()
      param_prefix = blob_out
  
      scale = self.create_param(
          param_name=param_prefix + "_s",
          initializer=initializers.Initializer(
              "ConstantFill", value=1.0
          ),
          tags=ParameterTags.WEIGHT,
          shape=[
              dim,
          ],
      )
      bias = self.create_param(
          param_name=param_prefix + "_b",
          initializer=initializers.Initializer(
              "ConstantFill", value=0.0
          ),
          tags=ParameterTags.BIAS,
          shape=[
              dim,
          ],
      )
      if inplace:
          return self.net.AffineChannel([blob_in, scale, bias], blob_in)
      else:
          return self.net.AffineChannel(
              [blob_in, scale, bias], blob_out
          )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from __future__ import unicode_literals
  import numpy
  import logging
  from caffe2.python import cnn
  from caffe2.python import core
  from caffe2.python import workspace
  from caffe2.python.modeling import initializers
  from caffe2.python.modeling.parameter_info import ParameterTags
  from detectron.core.config import cfg
  from detectron.ops.collect_and_distribute_fpn_rpn_proposals import CollectAndDistributeFpnRpnProposalsOp
  from detectron.ops.generate_proposal_labels import GenerateProposalLabelsOp
  from detectron.ops.generate_proposals import GenerateProposalsOp
  import detectron.roi_data.fast_rcnn
  import detectron.utils.c2
label_desc: Use image node_id 3 for calling the DetectionModelHelper obj's underlying member method code with example usage: obj.AffineChannel(blob_in, blob_out, dim, inplace) and returns: self, self