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

tensor pretty print & summarize #869

Merged

Conversation

macroexpansion
Copy link
Contributor

@macroexpansion macroexpansion commented Oct 15, 2023

Pull Request Template

Checklist

  • Confirm that run-checks script has been executed.

Related Issues/PRs

#850

Changes

  • I have refactored methods display_recursive, fmt_inner_tensor, fmt_outer_tensor and push_newline_indent to pretty print tensor and print ellipses (summarizing) when tensors get too large.
  • Added PrintOptions to control how and when tensor will be pretty printed and summarized.
  • This implementation is similar to candle's implementation for pretty print.
  • Fixed old test cases to work with pretty print.

Testing

  • Added test cases to summarize large tensors.

Copy link
Member

@nathanielsimard nathanielsimard left a comment

Choose a reason for hiding this comment

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

LGTM @louisfd do you see something we should change before we merge?

@louisfd
Copy link
Member

louisfd commented Oct 16, 2023

I tested it on @macroexpansion 's fork. It works well! I'll merge it

@louisfd louisfd merged commit 8226460 into tracel-ai:main Oct 16, 2023
5 checks passed
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.

None yet

3 participants