Added code to calculate new shape when '-1' is provided as a value for a dimension.
Optimized new code and improved the tests.
Reworked reshape test to ensure that atleast one -1 value is permitted.
Merge pull request #2149 from daemonmaker/issue1477

Added code to calculate new shape when '-1' is provided as a value for a...