From 645a7f7427ac437ba3429a8c57c159887b1da67d Mon Sep 17 00:00:00 2001 From: Frank Liu Date: Mon, 9 Aug 2021 21:06:22 -0700 Subject: [PATCH] Avoid exception in NDArray.toString() Change-Id: I75e32ba17bdab38d04318ae72cf18a45a1e1b5c3 --- api/src/main/java/ai/djl/ndarray/NDArrayAdapter.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/src/main/java/ai/djl/ndarray/NDArrayAdapter.java b/api/src/main/java/ai/djl/ndarray/NDArrayAdapter.java index 86967874627..a328207b672 100644 --- a/api/src/main/java/ai/djl/ndarray/NDArrayAdapter.java +++ b/api/src/main/java/ai/djl/ndarray/NDArrayAdapter.java @@ -65,7 +65,7 @@ default NDArray getGradient() { /** {@inheritDoc} */ @Override default boolean hasGradient() { - throw new UnsupportedOperationException(UNSUPPORTED_MSG); + return false; } /** {@inheritDoc} */