diff options
author | Marcin Junczys-Dowmunt <junczys@amu.edu.pl> | 2017-10-25 19:27:37 +0300 |
---|---|---|
committer | Marcin Junczys-Dowmunt <junczys@amu.edu.pl> | 2017-10-25 19:27:37 +0300 |
commit | 281a3344602deb8cb67a5fd254d9727008e77dab (patch) | |
tree | 62298105430c33726b01a7ac4ff54129355ea29c /src/graph/node_operators_unary.h | |
parent | f69870a7902e79e02e3e7753db6f351ffde4a85e (diff) |
dynamic gpu shape
Diffstat (limited to 'src/graph/node_operators_unary.h')
-rw-r--r-- | src/graph/node_operators_unary.h | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/graph/node_operators_unary.h b/src/graph/node_operators_unary.h index 3eb1c7ae..852d6d02 100644 --- a/src/graph/node_operators_unary.h +++ b/src/graph/node_operators_unary.h @@ -336,10 +336,9 @@ struct SumNodeOp : public UnaryNodeOp { if(ax != -1) { shape.set(ax, 1); } else { - shape.set(0, 1); - shape.set(1, 1); - shape.set(2, 1); - shape.set(3, 1); + for(int i = 0; i < shape.size(); ++i) { + shape.set(i, 1); + } } return shape; } @@ -397,10 +396,9 @@ struct MeanNodeOp : public UnaryNodeOp { if(ax != -1) { shape.set(ax, 1); } else { - shape.set(0, 1); - shape.set(1, 1); - shape.set(2, 1); - shape.set(3, 1); + for(int i = 0; i < shape.size(); ++i) { + shape.set(i, 1); + } } return shape; } |