Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit3d5585a

Browse files
authored
Merge pull request#26807 from oscargus/torchfix
Catch ValueError to support pytorch (and others) plotting
2 parents8f3e9e6 +a75771b commit3d5585a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

‎lib/matplotlib/cbook.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1685,7 +1685,7 @@ def safe_first_element(obj):
16851685
def_safe_first_finite(obj,*,skip_nonfinite=True):
16861686
"""
16871687
Return the first finite element in *obj* if one is available and skip_nonfinite is
1688-
True. Otherwise return the first element.
1688+
True. Otherwise, return the first element.
16891689
16901690
This is a method for internal use.
16911691
@@ -1697,7 +1697,7 @@ def safe_isfinite(val):
16971697
returnFalse
16981698
try:
16991699
returnmath.isfinite(val)
1700-
exceptTypeError:
1700+
except(TypeError,ValueError):
17011701
pass
17021702
try:
17031703
returnnp.isfinite(val)ifnp.isscalar(val)elseTrue

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp