Skip to content

Commit

Permalink
Merge pull request #3 from janhenrikbern/master
Browse files Browse the repository at this point in the history
Assert float input type for Scalar class
  • Loading branch information
srush authored Sep 21, 2020
2 parents 5c005d0 + 97ed981 commit 3f098d9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion minitorch/scalar.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class Scalar(Variable):

def __init__(self, v, back=History(), name=None):
super().__init__(back, name=name)
self.data = v
self.data = float(v)

def __repr__(self):
return "Scalar(%f)" % self.data
Expand Down

0 comments on commit 3f098d9

Please sign in to comment.