class_docstr: A layer reshaping its input tensor to another tensor of the same total
  number of elements.
  
  Parameters
  ----------
  incoming : a :class:`Layer` instance or a tuple
      The layer feeding into this layer, or the expected input shape
  
  shape : tuple
      The target shape specification. Each element can be one of:
  
      * ``i``, a positive integer directly giving the size of the dimension
      * ``[i]``, a single-element list of int, denoting to use the size
        of the ``i`` th input dimension
      * ``-1``, denoting to infer the size for this dimension to match
        the total number of elements in the input tensor (cannot be used
        more than once in a specification)
      * TensorVariable directly giving the size of the dimension
  
  Examples
  --------
  >>> from lasagne.layers import InputLayer, ReshapeLayer
  >>> l_in = InputLayer((32, 100, 20))
  >>> l1 = ReshapeLayer(l_in, ((32, 50, 40)))
  >>> l1.output_shape
  (32, 50, 40)
  >>> l_in = InputLayer((None, 100, 20))
  >>> l1 = ReshapeLayer(l_in, ([0], [1], 5, -1))
  >>> l1.output_shape
  (None, 100, 5, 4)
  
  Notes
  -----
  The tensor elements will be fetched and placed in C-like order. That
  is, reshaping `[1,2,3,4,5,6]` to shape `(2,3)` will result in a matrix
  `[[1,2,3],[4,5,6]]`, not in `[[1,3,5],[2,4,6]]` (Fortran-like order),
  regardless of the memory layout of the input tensor. For C-contiguous
  input, reshaping is cheap, for others it may require copying the data.
code: def __init__(self, incoming, shape, **kwargs):
      super(ReshapeLayer, self).__init__(incoming, **kwargs)
      shape = tuple(shape)
      for s in shape:
          if isinstance(s, int_types):
              if s == 0 or s < -1:
                  raise ValueError(
                      "`shape` integers must be positive or -1"
                  )
          elif isinstance(s, list):
              if (
                  len(s) != 1
                  or not isinstance(s[0], int_types)
                  or s[0] < 0
              ):
                  raise ValueError(
                      "`shape` input references must be "
                      "single-element lists of int >= 0"
                  )
          elif isinstance(s, T.TensorVariable):
              if s.ndim != 0:
                  raise ValueError(
                      "A symbolic variable in a shape specification must be "
                      "a scalar, but had %i dimensions" % s.ndim
                  )
          else:
              raise ValueError(
                  "`shape` must be a tuple of int and/or [int]"
              )
      if sum(s == -1 for s in shape) > 1:
          raise ValueError("`shape` cannot contain multiple -1")
      self.shape = shape
      # try computing the output shape once as a sanity check
      self.get_output_shape_for(self.input_shape)
  
imports: import numpy
  import theano.tensor
  from ..theano_extensions import padding
  from ..utils import int_types
  from .base import Layer
label_desc: Use image node_id 1 to create a new ReshapeLayer object from inherited base classes: Layer with example: obj = ReshapeLayer(incoming, shape)