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 get_output_shape_for(self, input_shape, **kwargs):
      # Initialize output shape from shape specification
      output_shape = list(self.shape)
      # First, replace all `[i]` with the corresponding input dimension, and
      # mask parts of the shapes thus becoming irrelevant for -1 inference
      masked_input_shape = list(input_shape)
      masked_output_shape = list(output_shape)
      for dim, o in enumerate(output_shape):
          if isinstance(o, list):
              if o[0] >= len(input_shape):
                  raise ValueError(
                      "specification contains [%d], but input "
                      "shape has %d dimensions only"
                      % (o[0], len(input_shape))
                  )
              output_shape[dim] = input_shape[o[0]]
              masked_output_shape[dim] = input_shape[o[0]]
              if (input_shape[o[0]] is None) and (
                  masked_input_shape[o[0]] is None
              ):
                  # first time we copied this unknown input size: mask
                  # it, we have a 1:1 correspondence between out[dim] and
                  # in[o[0]] and can ignore it for -1 inference even if
                  # it is unknown.
                  masked_input_shape[o[0]] = 1
                  masked_output_shape[dim] = 1
      # Secondly, replace all symbolic shapes with `None`, as we cannot
      # infer their size here.
      for dim, o in enumerate(output_shape):
          if isinstance(o, T.TensorVariable):
              output_shape[dim] = None
              masked_output_shape[dim] = None
      # From the shapes, compute the sizes of the input and output tensor
      input_size = (
          None
          if any(x is None for x in masked_input_shape)
          else np.prod(masked_input_shape)
      )
      output_size = (
          None
          if any(x is None for x in masked_output_shape)
          else np.prod(masked_output_shape)
      )
      del masked_input_shape, masked_output_shape
      # Finally, infer value for -1 if needed
      if -1 in output_shape:
          dim = output_shape.index(-1)
          if (input_size is None) or (output_size is None):
              output_shape[dim] = None
              output_size = None
          else:
              output_size *= -1
              output_shape[dim] = input_size // output_size
              output_size *= output_shape[dim]
      # Sanity check
      if (
          (input_size is not None)
          and (output_size is not None)
          and (input_size != output_size)
      ):
          raise ValueError(
              "%s cannot be reshaped to specification %s. "
              "The total size mismatches." % (input_shape, self.shape)
          )
      return tuple(output_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 2 for calling the ReshapeLayer obj's underlying member method code with example usage: obj.get_output_shape_for(input_shape) and returns: tuple