diff options
author | Frank Seide <fseide@microsoft.com> | 2019-01-23 02:25:53 +0300 |
---|---|---|
committer | Frank Seide <fseide@microsoft.com> | 2019-01-23 02:25:53 +0300 |
commit | 49668f1587b2bf08b182d4753a3ff48f76f3403c (patch) | |
tree | 44dbbde4409859c9841fb314e8c110853b429a73 /src/graph/node_operators_unary.h | |
parent | c1c175f99522da1611c0847c6fc3152d423a24fa (diff) | |
parent | 7ae9709043cdcc4f9bf38e9519f06e9eccaf58eb (diff) |
Merge branch 'fseide/indexops' into fseide/factoredembeddings
Diffstat (limited to 'src/graph/node_operators_unary.h')
-rwxr-xr-x | src/graph/node_operators_unary.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/graph/node_operators_unary.h b/src/graph/node_operators_unary.h index 3530d2bf..6dd90faf 100755 --- a/src/graph/node_operators_unary.h +++ b/src/graph/node_operators_unary.h @@ -761,15 +761,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 |