Commit 960133e
authored
Don't fail
Under some conditions, converting the variable value to numpy may fail. We don't want to fail `__repr__` in this case. I my example, this was preventing this exception from being raised and osbcuring the real issue:
https://github.com/keras-team/keras/blob/master/keras/src/backend/common/variables.py#L281-L288
Additionally, the exception was not reporting the shape used for comparison (`self.shape`).Variable.__repr__ if the value cannot be retrieved. (#21788)1 parent adbfd13 commit 960133e
1 file changed
+6
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
282 | 282 | | |
283 | 283 | | |
284 | 284 | | |
285 | | - | |
| 285 | + | |
286 | 286 | | |
287 | 287 | | |
288 | 288 | | |
| |||
399 | 399 | | |
400 | 400 | | |
401 | 401 | | |
402 | | - | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
403 | 407 | | |
404 | 408 | | |
405 | 409 | | |
| |||
0 commit comments