Merged
Conversation
qingqing01
reviewed
Jun 5, 2018
paddle/fluid/operators/slice_op.cc
Outdated
| elements before the end of that dimension. If the value passed to start or end is larger | ||
| than the n (the number of elements in this dimension), it represents n. For slicing to the | ||
| end of a dimension with unknown size, it is recommended to pass in INT_MAX. If axes are omitted, | ||
| they are set to [0, ..., ndim-1]. |
Contributor
There was a problem hiding this comment.
Each line should not be more than 80 characters. Please fix the lines above.
paddle/fluid/operators/slice_op.h
Outdated
| using Tensor = framework::Tensor; | ||
| template <typename T, size_t D, int MajorType = Eigen::RowMajor, | ||
| typename IndexType = Eigen::DenseIndex> | ||
| using EigenTensor = framework::EigenTensor<T, D, MajorType, IndexType>; |
Contributor
There was a problem hiding this comment.
Do not use using in the header file.
kuke
reviewed
Jun 6, 2018
| AddComment(R"DOC( | ||
| Slice Operator. | ||
|
|
||
| Produces a slice of the input tensor along multiple axes. Similar to numpy: |
Contributor
There was a problem hiding this comment.
Seems that there are some typos in onnx doc, please correct them:
Slices --> Slice
axes, starts and ends --> axes, starts and ends
represent --> represents
...
| public: | ||
| void Compute(const framework::ExecutionContext& ctx) const override { | ||
| int rank = ctx.Input<framework::Tensor>("Input")->dims().size(); | ||
| switch (rank) { |
|
Will there be a slice_grad_op? |
Contributor
Author
|
@tonyyang-svail |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
https://github.com/onnx/onnx/blob/master/docs/Operators.md#slice