parameters: (self, input_shape, output_shape)
return_statement: return output_shape
docstring: Find and replace a missing dimension in an output shape.
  
      This is a near direct port of the internal Numpy function
      `_fix_unknown_dimension` in `numpy/core/src/multiarray/shape.c`
  
      Arguments:
          input_shape: shape of array being reshaped
          output_shape: desired shape of the array with at most
              a single -1 which indicates a dimension that should be
              derived from the input shape.
  
      Returns:
          The new output shape with a -1 replaced with its computed value.
  
          Raises a ValueError if the total array size of the output_shape is
          different then the input_shape, or more then one unknown dimension
          is specified.
  
      Raises:
          ValueError: in case of invalid values
              for `input_shape` or `input_shape`.
docstring_summary: Find and replace a missing dimension in an output shape.
docstring_tokens: Find and replace a missing dimension in an output shape .
function: def _fix_unknown_dimension(self, input_shape, output_shape):
      """Find and replace a missing dimension in an output shape.
  
      This is a near direct port of the internal Numpy function
      `_fix_unknown_dimension` in `numpy/core/src/multiarray/shape.c`
  
      Arguments:
          input_shape: shape of array being reshaped
          output_shape: desired shape of the array with at most
              a single -1 which indicates a dimension that should be
              derived from the input shape.
  
      Returns:
          The new output shape with a -1 replaced with its computed value.
  
          Raises a ValueError if the total array size of the output_shape is
          different then the input_shape, or more then one unknown dimension
          is specified.
  
      Raises:
          ValueError: in case of invalid values
              for `input_shape` or `input_shape`.
      """
      output_shape = list(output_shape)
      msg = 'total size of new array must be unchanged'
  
      known, unknown = 1, None
      for index, dim in enumerate(output_shape):
        if dim < 0:
          if unknown is None:
            unknown = index
          else:
            raise ValueError('Can only specify one unknown dimension.')
        else:
          known *= dim
  
      original = np.prod(input_shape, dtype=int)
      if unknown is not None:
        if known == 0 or original % known != 0:
          raise ValueError(msg)
        output_shape[unknown] = original // known
      elif original != known:
        raise ValueError(msg)
      return output_shape
function_tokens: def _fix_unknown_dimension ( self , input_shape , output_shape ) : output_shape = list ( output_shape ) msg = 'total size of new array must be unchanged' known , unknown = 1 , None for index , dim in enumerate ( output_shape ) : if dim < 0 : if unknown is None : unknown = index else : raise ValueError ( 'Can only specify one unknown dimension.' ) else : known *= dim original = np . prod ( input_shape , dtype = int ) if unknown is not None : if known == 0 or original % known != 0 : raise ValueError ( msg ) output_shape [ unknown ] = original // known elif original != known : raise ValueError ( msg ) return output_shape