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

Add documentation examples for Tensor::i and Tensor::narrow methods #2308

Merged
merged 4 commits into from
Aug 10, 2024

Conversation

csicar
Copy link
Contributor

@csicar csicar commented Jul 2, 2024

  • adds doctest for .i(a), .i((a,), .i((a, b))
  • adds doctest for .narrow(dim, start, len)

Open question

  • should the index_op_tuple macro be kept? This would keep the verbosity low, but would mean that the doc comment is harder to read and looking at the source is harder. Both options are possible

@csicar csicar force-pushed the feature/tensor-index-docs branch from 77b5897 to f28f0e5 Compare July 3, 2024 18:58
Copy link

@wasup-yash wasup-yash left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

damn this is helpful xD

@LaurentMazare
Copy link
Collaborator

Thanks, and sorry for the delay!

@LaurentMazare LaurentMazare merged commit d3fe989 into huggingface:main Aug 10, 2024
10 checks passed
@csicar
Copy link
Contributor Author

csicar commented Aug 10, 2024

No worries :) Thank you for merging

@csicar csicar deleted the feature/tensor-index-docs branch August 10, 2024 07:53
EricLBuehler pushed a commit to EricLBuehler/candle that referenced this pull request Aug 14, 2024
…ds (huggingface#2308)

* Add documentation examples for `Tensor` methods

* Apply fmt.

* Cosmetic tweaks.

---------

Co-authored-by: Laurent <laurent.mazare@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants