File tree Expand file tree Collapse file tree 2 files changed +4
-5
lines changed
Expand file tree Collapse file tree 2 files changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -155,7 +155,7 @@ class Value : public std::enable_shared_from_this<Value> {
155155 }
156156
157157 friend std::ostream& operator <<(std::ostream& os, const Value& v) {
158- os << " Value(data=" << v.data << " , grad=" << v.grad << " )" ;
158+ os << " Value(data=" << v.data << " , grad=" << v.grad << " )" << std::endl ;
159159 return os;
160160 }
161161
Original file line number Diff line number Diff line change @@ -9,9 +9,8 @@ void test_sanity_check() {
99 y->backward ();
1010 auto xmg = x, ymg = y;
1111
12- std::cout << x << z << q << h << y << std::endl;
13- assert (ymg->data == -34.0 );
14- assert (xmg->grad == -46.0 );
12+ assert (ymg->data == -20.0 );
13+ assert (xmg->grad == 46.0 );
1514}
1615
1716void test_more_ops () {
@@ -33,7 +32,7 @@ void test_more_ops() {
3332 double tol = 1e-6 ;
3433 assert (std::abs (gmg->data - 24.70408163265306 ) < tol);
3534 assert (std::abs (amg->grad - 138.8338192419825 ) < tol);
36- assert (std::abs (bmg->grad - 645.5773207547171 ) < tol);
35+ assert (std::abs (bmg->grad - 645.5772594752186 ) < tol);
3736}
3837
3938void test_duplicate_backprop () {
You can’t perform that action at this time.
0 commit comments