class_docstr: 2D upscaling layer
  
  Performs 2D upscaling over the two trailing axes of a 4D input tensor.
  
  Parameters
  ----------
  incoming : a :class:`Layer` instance or tuple
      The layer feeding into this layer, or the expected input shape.
  
  scale_factor : integer or iterable
      The scale factor in each dimension. If an integer, it is promoted to
      a square scale factor region. If an iterable, it should have two
      elements.
  
  mode : {'repeat', 'dilate'}
      Upscaling mode: repeat element values or upscale leaving zeroes between
      upscaled elements. Default is 'repeat'.
  
  **kwargs
      Any additional keyword arguments are passed to the :class:`Layer`
      superclass.
  
  Notes
  -----
  Using ``mode='dilate'`` followed by a convolution can be
  realized more efficiently with a transposed convolution, see
  :class:`lasagne.layers.TransposedConv2DLayer`.
class_docstr_tok: ["2D","upscaling","layer","Performs","2D","upscaling","over","the","two","trailing","axes","of","a","4D","input","tensor",".","Parameters","--","--","--","--","--","incoming",":","a",":","class",":","`","Layer","`","instance","or","tuple","The","layer","feeding","into","this","layer",",","or","the","expected","input","shape",".","scale_factor",":","integer","or","iterable","The","scale","factor","in","each","dimension",".","If","an","integer",",","it","is","promoted","to","a","square","scale","factor","region",".","If","an","iterable",",","it","should","have","two","elements",".","mode",":","{","'repeat","'",",","'dilate","'","}","Upscaling","mode",":","repeat","element","values","or","upscale","leaving","zeroes","between","upscaled","elements",".","Default","is","'repeat","'",".","*","*","kwargs","Any","additional","keyword","arguments","are","passed","to","the",":","class",":","`","Layer","`","superclass",".","Notes","--","--","-","Using","``","mode='dilate","'","``","followed","by","a","convolution","can","be","realized","more","efficiently","with","a","transposed","convolution",",","see",":","class",":","`","lasagne.layers.TransposedConv2DLayer","`","."]
code: def get_output_for(self, input, **kwargs):
      a, b = self.scale_factor
      upscaled = input
      if self.mode == "repeat":
          if b > 1:
              upscaled = T.extra_ops.repeat(upscaled, b, 3)
          if a > 1:
              upscaled = T.extra_ops.repeat(upscaled, a, 2)
      elif self.mode == "dilate":
          if b > 1 or a > 1:
              output_shape = self.get_output_shape_for(input.shape)
              upscaled = T.zeros(shape=output_shape, dtype=input.dtype)
              upscaled = T.set_subtensor(
                  upscaled[:, :, ::a, ::b], input
              )
      return upscaled
  
imports: import theano.tensor
  from .base import Layer
  from ..utils import as_tuple
label_desc: Use image node_id 3 for calling the Upscale2DLayer obj's underlying member method code with example usage: obj.get_output_for(input) and returns: upscaled