Skip to content

Commit

Permalink
fix ci job
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewldesousa committed Jul 3, 2024
1 parent 7348deb commit 5e8f544
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scalar.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,21 +132,21 @@ class Scalar: public std::enable_shared_from_this<Scalar<T>> {
}

friend std::shared_ptr<Scalar<T>> exp(std::shared_ptr<Scalar<T>> rhs) {
auto result = Scalar<T>::make(std::exp(rhs->value));
auto result = Scalar<T>::make(exp(rhs->value));

result->children.insert(rhs);
rhs->in_degrees++;

result->_backward = [rhs, result]() {
rhs->grad += std::exp(rhs->value) * result->grad;
rhs->grad += exp(rhs->value) * result->grad;
};

return result;
}

// log
friend std::shared_ptr<Scalar<T>> log(std::shared_ptr<Scalar<T>> rhs) {
auto result = Scalar<T>::make(std::log(rhs->value));
auto result = Scalar<T>::make(log(rhs->value));

result->children.insert(rhs);
rhs->in_degrees++;
Expand Down

0 comments on commit 5e8f544

Please sign in to comment.