Skip to content

Commit

Permalink
Fix NPE bug in block.toString() function
Browse files Browse the repository at this point in the history
Change-Id: I2aa8bc6c8d36d01cc00c02778907b040d782330c
  • Loading branch information
frankfliu committed Jul 5, 2021
1 parent 7a7f41f commit 3815157
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions api/src/main/java/ai/djl/nn/AbstractBlock.java
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,9 @@ protected void prepare(Shape[] inputShapes) {}
/** {@inheritDoc} */
@Override
public boolean isInitialized() {
if (inputShapes == null) {
return false;
}
for (Parameter param : getParameters().values()) {
if (!param.isInitialized()) {
return false;
Expand Down

0 comments on commit 3815157

Please sign in to comment.