minitorch / Module-1

Module 1 - Autodifferentiation
20 stars 204 forks source link

Assert float input type for Scalar class #3

Closed janhenrikbern closed 4 years ago

janhenrikbern commented 4 years ago

This PR resolves the below type of downstream errors due to type mismatch. Screen Shot 2020-09-18 at 3 31 02 PM

New behavior: Screen Shot 2020-09-18 at 7 23 31 PM

Please refer to the Piazza question to read the issue thread.

srush commented 4 years ago

Thanks! Although maybe we should just cast it to a float?

janhenrikbern commented 4 years ago

Thanks! Although maybe we should just cast it to a float?

Sounds good; I revised the PR. ValueError exceptions should handle any incorrect inputs.