Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation for tf.strided_slice is nearly useless #5761

Closed
yaccman opened this issue Nov 21, 2016 · 3 comments
Closed

Documentation for tf.strided_slice is nearly useless #5761

yaccman opened this issue Nov 21, 2016 · 3 comments
Assignees
Labels
type:docs-bug Document issues

Comments

@yaccman
Copy link

yaccman commented Nov 21, 2016

The documentation for this op could almost be used as a teaching moment for how to not document something. In order to understand what it does, it is necessary to not only understand in detail how the related numpy op works, but also understand the mapping between the inputs of that op and the inputs of theTensorFlow op, that are totally different -- something that is far from obvious.

Just to ice the cake, the examples given in the document are for slice, not strided_slice...

Searches didn't turn up anything. TF version is .11. The machine and OS are not applicable.

@prb12 prb12 added the type:docs-bug Document issues label Nov 22, 2016
@aselle
Copy link
Contributor

aselle commented Nov 23, 2016

I apologize for the confusion and frustration. A few notes that might be of help.

  1. The examples actually are for strided_slice, and there has been a correction to the documentation just made to correct that.
  2. If operating in Python you almost always should use the tensor slice operator (i.e. getitem)
    https://www.tensorflow.org/versions/master/api_docs/python/framework.html#Tensor (and search for getitem)
  3. I will add a link referring to the the Tensor.getitem documentation from here, because that is almost always what you want to be using.
  4. If you have a suggestion on how to restructure the documentation to be more intuitive, I would be happy to integrate it. Perhaps a section that gives some examples of what it can do first. I do believe that what is there is useful for those that do know what the NumPy slice does, which is probably many people.

@xmbrst xmbrst assigned dr4b and unassigned xmbrst Nov 23, 2016
@krstovski
Copy link

The example code has a typo:
tf.slice -> tf.strided_slice
Also, the third example doesn't produce the given result:
tf.slice(input, [1, 1, 0], [2, -1, 3], [1, -1, 1]) !=> [[[4, 4, 4], [3, 3, 3]]]

@danielwatson6
Copy link

As of version .12, tf.strided_slice has [misleading documentation](https://www.tensorflow.org/versions/master/api_docs/python/array_ops/slicing_and_joining#strided_slice). A fourth argument is mandatory, not a keyword argument, and it cannot be None.

@vrv vrv closed this as completed in 3f68ed1 May 1, 2017
copybara-service bot pushed a commit that referenced this issue Sep 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:docs-bug Document issues
Projects
None yet
Development

No branches or pull requests

7 participants