class_docstr: This class defines a composite layer with optional components::
  
    channel sparse convolution ->
    batchwise-spatial dropout ->
    batch_norm ->
    activation
  
  The b_initializer and b_regularizer are applied to
  the ChannelSparseConvLayer, the w_initializer and w_regularizer
  are applied to the ChannelSparseConvLayer, the batch normalisation
  layer, and the activation layer (for 'prelu')
class_docstr_tok: ["This","class","defines","a","composite","layer","with","optional","components",":",":","channel","sparse","convolution","-",">","batchwise-spatial","dropout","-",">","batch_norm","-",">","activation","The","b_initializer","and","b_regularizer","are","applied","to","the","ChannelSparseConvLayer",",","the","w_initializer","and","w_regularizer","are","applied","to","the","ChannelSparseConvLayer",",","the","batch","normalisation","layer",",","and","the","activation","layer","(","for","'prelu","'",")"]
code: def __init__(
      self,
      n_output_chns,
      kernel_size=3,
      stride=1,
      dilation=1,
      padding="SAME",
      with_bias=False,
      feature_normalization="batch",
      acti_func=None,
      w_initializer=None,
      w_regularizer=None,
      b_initializer=None,
      b_regularizer=None,
      moving_decay=0.9,
      eps=1e-5,
      name="conv",
  ):
      self.acti_func = acti_func
      self.feature_normalization = feature_normalization
      self.layer_name = "{}".format(name)
      if self.feature_normalization == "batch":
          self.layer_name += "_bn"
      if self.acti_func is not None:
          self.layer_name += "_{}".format(self.acti_func)
      super(ChannelSparseConvolutionalLayer, self).__init__(
          name=self.layer_name
      )
  
      # for ConvLayer
      self.n_output_chns = n_output_chns
      self.kernel_size = kernel_size
      self.stride = stride
      self.dilation = dilation
      self.padding = padding
      self.with_bias = with_bias
  
      # for BNLayer
      self.moving_decay = moving_decay
      self.eps = eps
  
      self.initializers = {
          "w": w_initializer
          if w_initializer
          else niftynet.layer.convolution.default_w_initializer(),
          "b": b_initializer
          if b_initializer
          else niftynet.layer.convolution.default_b_initializer(),
      }
  
      self.regularizers = {"w": w_regularizer, "b": b_regularizer}
  
imports: from __future__ import absolute_import, print_function
  import math
  import numpy
  import tensorflow
  from tensorflow.python.training import moving_averages
  import niftynet.layer.bn
  import niftynet.layer.convolution
  import niftynet.layer.deconvolution
  from niftynet.layer import layer_util
  from niftynet.layer.activation import ActiLayer
  from niftynet.layer.base_layer import TrainableLayer
  from niftynet.layer.deconvolution import infer_output_dims
label_desc: Use image node_id 1 to create a new ChannelSparseConvolutionalLayer object from inherited base classes: TrainableLayer with example: obj = ChannelSparseConvolutionalLayer(n_output_chns, kernel_size, stride, dilation, padding, with_bias, feature_normalization, acti_func, w_initializer, w_regularizer, b_initializer, b_regularizer, moving_decay, eps, name)