-
Notifications
You must be signed in to change notification settings - Fork 654
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
Change NDArray.toString() output #1142
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1142 +/- ##
============================================
+ Coverage 70.12% 70.16% +0.04%
- Complexity 5329 5332 +3
============================================
Files 513 513
Lines 23696 23687 -9
Branches 2545 2546 +1
============================================
+ Hits 16617 16621 +4
+ Misses 5722 5707 -15
- Partials 1357 1359 +2
Continue to review full report at Codecov.
|
* @return the debug string representation of this {@code NDArray} | ||
*/ | ||
default String toDebugString() { | ||
int maxSize = Integer.getInteger("ai.djl.nd_display_limit", 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes the default maxSize 0, which means it won't show any NDArrays. We should probably have a larger default to allow some to be displayed. Maybe 100 like MxNDarray before?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently, toString() is called by default in debugger, retrieving the data makes the debugger very slow. The default should be 0. User can manually configure debugger to use toDebugString() when then expend the data view, this will be on-demand and won't impact performance.
We display the content mostly in Jupyter notebook, I'm consider add the property in the IJava kernel to workaround this issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would also affect println statements as well. Here is another option. What if we added something like this check to see if the JVM is running in debug mode?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now we won't print ndarray content in debugger
Change-Id: I4c0b29e56fd6ed214656cf2681337e595ecda4e3
Co-authored-by: Zach Kimberg <zachary@kimberg.com>
Change-Id: Icf10106d24553510084996444db7657734bb9f80
Change-Id: I4c0b29e56fd6ed214656cf2681337e595ecda4e3
Description
Brief description of what this PR is about