class_docstr: This class defines channel-wise upsampling operations.
  Different from ``DeconvLayer``,
  the elements are not mixed in the channel dim.
  
  ``REPLICATE`` mode replicates each spatial_dim into
  ``spatial_dim*kernel_size``
  `CHANNELWISE_DECONV`` mode makes a projection using a kernel.
  e.g., With 2D input (without loss of generality), given input
  ``[N, X, Y, C]``, the output is ``[N, X*kernel_size, Y*kernel_size, C]``.
class_docstr_tok: ["This","class","defines","channel-wise","upsampling","operations",".","Different","from","``","DeconvLayer","``",",","the","elements","are","not","mixed","in","the","channel","dim",".","``","REPLICATE","``","mode","replicates","each","spatial_dim","into","``","spatial_dim","*","kernel_size","``","`","CHANNELWISE_DECONV","``","mode","makes","a","projection","using","a","kernel",".","e.g.",",","With","2D","input","(","without","loss","of","generality",")",",","given","input","``","[","N",",","X",",","Y",",","C","]","``",",","the","output","is","``","[","N",",","X","*","kernel_size",",","Y","*","kernel_size",",","C","]","``","."]
code: def __init__(
      self,
      func,
      kernel_size=3,
      stride=2,
      w_initializer=None,
      w_regularizer=None,
      with_bias=False,
      b_initializer=None,
      b_regularizer=None,
      name="upsample",
  ):
      self.func = look_up_operations(func.upper(), SUPPORTED_OP)
      self.layer_name = "{}_{}".format(self.func.lower(), name)
      super(UpSampleLayer, self).__init__(name=self.layer_name)
  
      self.kernel_size = kernel_size
      self.stride = stride
      self.with_bias = with_bias
  
      self.initializers = {"w": w_initializer, "b": b_initializer}
      self.regularizers = {"w": w_regularizer, "b": b_regularizer}
  
file_path: NiftyNet/niftynet/layer/upsample.py
imports: from __future__ import absolute_import, print_function
  import numpy
  import tensorflow
  from niftynet.layer import layer_util
  from niftynet.layer.base_layer import TrainableLayer
  from niftynet.layer.deconvolution import DeconvLayer
  from niftynet.utilities.util_common import look_up_operations
label_desc: Use image node_id 1 to create a new UpSampleLayer object from inherited base classes: TrainableLayer with example: obj = UpSampleLayer(func, kernel_size, stride, w_initializer, w_regularizer, with_bias, b_initializer, b_regularizer, name)