class_docstr: It is a 2D sub-pixel up-sampling layer, usually be used
  for Super-Resolution applications, see `SRGAN <https://github.com/tensorlayer/srgan/>`__ for example.
  
  Parameters
  ------------
  scale : int
      The up-scaling ratio, a wrong setting will lead to dimension size error.
  n_out_channel : int or None
      The number of output channels.
      - If None, automatically set n_out_channel == the number of input channels / (scale x scale).
      - The number of input channels == (scale x scale) x The number of output channels.
  act : activation function
      The activation function of this layer.
  in_channels : int
      The number of in channels.
  name : str
      A unique layer name.
  
  Examples
  ---------
  With TensorLayer
  
  >>> # examples here just want to tell you how to set the n_out_channel.
  >>> net = tl.layers.Input([2, 16, 16, 4], name='input1')
  >>> subpixelconv2d = tl.layers.SubpixelConv2d(scale=2, n_out_channel=1, name='subpixel_conv2d1')(net)
  >>> print(subpixelconv2d)
  >>> output shape : (2, 32, 32, 1)
  
  >>> net = tl.layers.Input([2, 16, 16, 4*10], name='input2')
  >>> subpixelconv2d = tl.layers.SubpixelConv2d(scale=2, n_out_channel=10, name='subpixel_conv2d2')(net)
  >>> print(subpixelconv2d)
  >>> output shape : (2, 32, 32, 10)
  
  >>> net = tl.layers.Input([2, 16, 16, 25*10], name='input3')
  >>> subpixelconv2d = tl.layers.SubpixelConv2d(scale=5, n_out_channel=10, name='subpixel_conv2d3')(net)
  >>> print(subpixelconv2d)
  >>> output shape : (2, 80, 80, 10)
  
  References
  ------------
  - `Real-Time Single Image and Video Super-Resolution Using an Efficient Sub-Pixel Convolutional Neural Network <https://arxiv.org/pdf/1609.05158.pdf>`__
class_docstr_tok: ["It","is","a","2D","sub-pixel","up-sampling","layer",",","usually","be","used","for","Super-Resolution","applications",",","see","`","SRGAN","<","https",":","\/\/github.com\/tensorlayer\/srgan\/",">","`","__","for","example",".","Parameters","--","--","--","--","--","--","scale",":","int","The","up-scaling","ratio",",","a","wrong","setting","will","lead","to","dimension","size","error",".","n_out_channel",":","int","or","None","The","number","of","output","channels",".","-","If","None",",","automatically","set","n_out_channel","==","the","number","of","input","channels","\/","(","scale","x","scale",")",".","-","The","number","of","input","channels","==","(","scale","x","scale",")","x","The","number","of","output","channels",".","act",":","activation","function","The","activation","function","of","this","layer",".","in_channels",":","int","The","number","of","in","channels",".","name",":","str","A","unique","layer","name",".","Examples","--","--","--","--","-","With","TensorLayer",">",">",">","#","examples","here","just","want","to","tell","you","how","to","set","the","n_out_channel",".",">",">",">","net","=","tl.layers.Input","(","[","2",",","16",",","16",",","4","]",",","name='input1","'",")",">",">",">","subpixelconv2d","=","tl.layers.SubpixelConv2d","(","scale=2",",","n_out_channel=1",",","name='subpixel_conv2d1","'",")","(","net",")",">",">",">","print","(","subpixelconv2d",")",">",">",">","output","shape",":","(","2",",","32",",","32",",","1",")",">",">",">","net","=","tl.layers.Input","(","[","2",",","16",",","16",",","4","*","10","]",",","name='input2","'",")",">",">",">","subpixelconv2d","=","tl.layers.SubpixelConv2d","(","scale=2",",","n_out_channel=10",",","name='subpixel_conv2d2","'",")","(","net",")",">",">",">","print","(","subpixelconv2d",")",">",">",">","output","shape",":","(","2",",","32",",","32",",","10",")",">",">",">","net","=","tl.layers.Input","(","[","2",",","16",",","16",",","25","*","10","]",",","name='input3","'",")",">",">",">","subpixelconv2d","=","tl.layers.SubpixelConv2d","(","scale=5",",","n_out_channel=10",",","name='subpixel_conv2d3","'",")","(","net",")",">",">",">","print","(","subpixelconv2d",")",">",">",">","output","shape",":","(","2",",","80",",","80",",","10",")","References","--","--","--","--","--","--","-","`","Real-Time","Single","Image","and","Video","Super-Resolution","Using","an","Efficient","Sub-Pixel","Convolutional","Neural","Network","<","https",":","\/\/arxiv.org\/pdf\/1609.05158.pdf",">","`","__"]
code: def __init__(
      self,
      scale=2,
      n_out_channels=None,
      act=None,
      in_channels=None,
      name=None,  # 'subpixel_conv2d'
  ):
      super().__init__(name, act=act)
      self.scale = scale
      self.n_out_channels = n_out_channels
      self.in_channels = in_channels
  
      if self.in_channels is not None:
          self.build(None)
          self._built = True
      logging.info(
          "SubpixelConv2d  %s: scale: %d act: %s"
          % (
              self.name,
              scale,
              self.act.__name__
              if self.act is not None
              else "No Activation",
          )
      )
  
file_path: TensorLayer/tensorlayer/layers/convolution/super_resolution.py
imports: import tensorflow
  import tensorlayer
  from tensorlayer import logging
  from tensorlayer.decorators import deprecated_alias, private_method
  from tensorlayer.layers.core import Layer
label_desc: Use image node_id 1 to create a new SubpixelConv2d object from inherited base classes: Layer with example: obj = SubpixelConv2d(scale, n_out_channels, act, in_channels, name)