class_docstr: Implementation of bilinear (or trilinear) additive upsampling layer,
  described in paper:
  
      Wojna et al., The devil is in the decoder,
      https://arxiv.org/abs/1707.05847
  
  In the paper 2D images are upsampled by a factor of 2 and ``n_splits = 4``
docstr: If the input has the shape ``batch, X, Y,[ Z,] Channels``,
  the output will be
  ``batch, new_size_x, new_size_y,[ new_size_z,] channels/n_splits``.
  
  :param input_tensor: 2D/3D image tensor, with shape:
      ``batch, X, Y,[ Z,] Channels``
  :return: linearly additively upsampled volumes
docstr_tok: ["If","the","input","has","the","shape","``","batch",",","X",",","Y",",","[","Z",",","]","Channels","``",",","the","output","will","be","``","batch",",","new_size_x",",","new_size_y",",","[","new_size_z",",","]","channels\/n_splits","``",".",":","param","input_tensor",":","2D\/3D","image","tensor",",","with","shape",":","``","batch",",","X",",","Y",",","[","Z",",","]","Channels","``",":","return",":","linearly","additively","upsampled","volumes"]
code: def layer_op(self, input_tensor):
      """
      If the input has the shape ``batch, X, Y,[ Z,] Channels``,
      the output will be
      ``batch, new_size_x, new_size_y,[ new_size_z,] channels/n_splits``.
  
      :param input_tensor: 2D/3D image tensor, with shape:
          ``batch, X, Y,[ Z,] Channels``
      :return: linearly additively upsampled volumes
      """
      check_divisible_channels(input_tensor, self.n_splits)
  
      resizing_layer = ResizingLayer(self.new_size)
      split = tf.split(
          resizing_layer(input_tensor), self.n_splits, axis=-1
      )
      split_tensor = tf.stack(split, axis=-1)
      output_tensor = tf.reduce_sum(split_tensor, axis=-1)
      return output_tensor
  
file_path: NiftyNet/niftynet/layer/additive_upsample.py
imports: from __future__ import absolute_import, print_function
  import tensorflow
  from niftynet.layer.base_layer import Layer
  from niftynet.layer.base_layer import TrainableLayer
  from niftynet.layer.linear_resize import LinearResizeLayer
  from niftynet.layer.deconvolution import DeconvolutionalLayer
  from niftynet.layer.layer_util import check_divisible_channels
  from niftynet.layer.elementwise import ElementwiseLayer
label_desc: Use image node_id 2 for calling the AdditiveUpsampleLayer obj's underlying member method code with example usage: obj.layer_op(input_tensor) and returns: output_tensor