docstr: Consists of::
  
      (inputs)--upsampling-+-o--conv_1--conv_2--+--(conv_res)--
                           | |                  |
      (forwarding)---------o o------------------o
  
  where upsampling method could be ``DeconvolutionalLayer``
  or ``ResidualUpsampleLayer``
docstr_tok: ["Consists","of",":",":","(","inputs",")","--","upsampling-+-o","--","conv_1","--","conv_2","--","+","--","(","conv_res",")","--","|","|","|","(","forwarding",")","--","--","--","--","-o","o","--","--","--","--","--","--","--","--","--","o","where","upsampling","method","could","be","``","DeconvolutionalLayer","``","or","``","ResidualUpsampleLayer","``"]
code: def layer_op(self, inputs, forwarding=None, is_training=True):
      """
      Consists of::
  
          (inputs)--upsampling-+-o--conv_1--conv_2--+--(conv_res)--
                               | |                  |
          (forwarding)---------o o------------------o
  
      where upsampling method could be ``DeconvolutionalLayer``
      or ``ResidualUpsampleLayer``
      """
      if self.is_residual_upsampling:
          n_input_channels = inputs.get_shape().as_list()[-1]
          n_splits = float(n_input_channels) / float(self.n_output_chns)
          upsampled = ResUp(
              kernel_size=self.kernel_size,
              stride=self.upsample_stride,
              n_splits=n_splits,
              acti_func=self.acti_func,
              **self.conv_param,
          )(inputs, is_training)
      else:
          upsampled = Deconv(
              n_output_chns=self.n_output_chns,
              kernel_size=self.kernel_size,
              stride=self.upsample_stride,
              acti_func=self.acti_func,
              with_bias=False,
              feature_normalization="batch",
              **self.conv_param,
          )(inputs, is_training)
  
      if forwarding is None:
          conv_0 = upsampled
      else:
          conv_0 = ElementwiseLayer("SUM")(upsampled, forwarding)
  
      conv_res = ResUnit(
          n_output_chns=self.n_output_chns,
          kernel_size=self.kernel_size,
          acti_func=self.acti_func,
          type_string=self.type_string,
          **self.conv_param,
      )(conv_0, is_training)
      return conv_res
  
file_path: NiftyNet/niftynet/layer/upsample_res_block.py
imports: from __future__ import absolute_import, print_function
  from niftynet.layer.additive_upsample import ResidualUpsampleLayer
  from niftynet.layer.base_layer import TrainableLayer
  from niftynet.layer.deconvolution import DeconvolutionalLayer
  from niftynet.layer.elementwise import ElementwiseLayer
  from niftynet.layer.residual_unit import ResidualUnit
label_desc: Use image node_id 2 for calling the UpBlock obj's underlying member method code with example usage: obj.layer_op(inputs, forwarding, is_training) and returns: conv_res