From 0a62d1e2d051105cb25a83cc3ab348e4b19c50df Mon Sep 17 00:00:00 2001 From: Frank Seide Date: Tue, 22 Jan 2019 15:08:32 -0800 Subject: changed index operations' parameter lists to match PyTorch parameter order (axis before arg) --- src/graph/node_operators_unary.h | 6 +++--- 1 file changed, 3 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 51433f93..7dbaec46 100755 --- a/src/graph/node_operators_unary.h +++ b/src/graph/node_operators_unary.h @@ -745,15 +745,15 @@ private: size_t byteOffset_, byteSize_; // viewed segment in bytes (memory-consecutive) public: - SliceViewNodeOp(Expr a, Slice slice, int axis) - : UnaryNodeOp(a, newShape(a, slice, axis), a->value_type()), viewedNode_(a), slice_(slice), axis_(axis) { + SliceViewNodeOp(Expr a, int axis, Slice slice) + : UnaryNodeOp(a, newShape(a, axis, slice), a->value_type()), viewedNode_(a), slice_(slice), axis_(axis) { Node::destroy_ = false; auto byteStride = a->shape().stride(axis) * sizeOf(value_type()); byteOffset_ = slice.begin * byteStride; byteSize_ = shape()[axis] * byteStride; } - static Shape newShape(Expr a, Slice& slice, int& axis) { // note: normalizes slice and axis in-place + static Shape newShape(Expr a, int& axis, Slice& slice) { // note: normalizes slice and axis in-place const auto& shape = a->shape(); axis = shape.axis(axis); // normalize negative axis slice = shape.slice(slice, axis); // normalize negative slice values -- cgit v1.2.3