From 9d06d786ba568e74f54be98f5a23d9b53d87ed7b Mon Sep 17 00:00:00 2001 From: Marcin Junczys-Dowmunt Date: Thu, 2 Nov 2017 20:58:56 +0100 Subject: farewell thrust --- src/graph/node_operators_unary.h | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'src/graph/node_operators_unary.h') diff --git a/src/graph/node_operators_unary.h b/src/graph/node_operators_unary.h index 05294bee..9d5b8287 100644 --- a/src/graph/node_operators_unary.h +++ b/src/graph/node_operators_unary.h @@ -55,7 +55,10 @@ public: return {NodeOp(Element(_1 = _2 + scalar_, val_, child(0)->val()))}; } - NodeOps backwardOps() { return {NodeOp(Add(_1, child(0)->grad(), adj_))}; } + NodeOps backwardOps() { + using namespace functional; + return {NodeOp(Add(_1, child(0)->grad(), adj_))}; + } const std::string type() { return "scalar_add"; } }; @@ -392,9 +395,14 @@ struct SumNodeOp : public UnaryNodeOp { SumNodeOp(Expr a, Args... args) : UnaryNodeOp(a, keywords::shape = newShape(a, args...), args...) {} - NodeOps forwardOps() { return {NodeOp(Reduce(_1, val_, child(0)->val()))}; } + NodeOps forwardOps() { + using namespace functional; + + return {NodeOp(Reduce(_1, val_, child(0)->val()))}; } - NodeOps backwardOps() { return {NodeOp(Add(_1, child(0)->grad(), adj_))}; } + NodeOps backwardOps() { + using namespace functional; + return {NodeOp(Add(_1, child(0)->grad(), adj_))}; } template Shape newShape(Expr a, Args... args) { -- cgit v1.2.3