Skip to content

Commit

Permalink
Update engines/pytorch/pytorch-native/src/main/native/ai_djl_pytorch_…
Browse files Browse the repository at this point in the history
…jni_PyTorchLibrary_tensor.cc
  • Loading branch information
zachgk committed Sep 13, 2023
1 parent fd61db3 commit 00a212e
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ JNIEXPORT jbyteArray JNICALL Java_ai_djl_pytorch_jni_PyTorchLibrary_torchDataPtr
tensor = (tensor.is_contiguous()) ? tensor : tensor.contiguous();
size_t nbytes = tensor.nbytes();
if (nbytes > 0x7fffffff) {
env->ThrowNew(ENGINE_EXCEPTION_CLASS, "toByteBuffer() is notsupported for large tensor");
env->ThrowNew(ENGINE_EXCEPTION_CLASS, "toByteBuffer() is not supported for large tensor");
return env->NewByteArray(0);
}
jbyteArray result = env->NewByteArray(nbytes);
Expand Down

0 comments on commit 00a212e

Please sign in to comment.