Skip to content

Commit 1e18948

Browse files
frankfliuCraigacp
authored andcommitted
Fix NullPointerException issue. (tensorflow#407)
1 parent b76a888 commit 1e18948

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/EagerOperation.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,9 +190,9 @@ private static Tensor resolveTensorHandle(TFE_TensorHandle handle, EagerSession
190190
requireTensorHandle(handle);
191191
try (PointerScope scope = new PointerScope()) {
192192
TF_Status status = TF_Status.newStatus();
193-
TF_Tensor tensor = TFE_TensorHandleResolve(handle, status).withDeallocator();
193+
TF_Tensor tensor = TFE_TensorHandleResolve(handle, status);
194194
status.throwExceptionIfNotOK();
195-
return RawTensor.fromHandle(tensor, session).asTypedTensor();
195+
return RawTensor.fromHandle(tensor.withDeallocator(), session).asTypedTensor();
196196
}
197197
}
198198

0 commit comments

Comments
 (0)