mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-05-14 20:48:00 +00:00
Fix codeql java warning (#7280)
This commit is contained in:
parent
0d49e53985
commit
4969431eba
2 changed files with 1 additions and 3 deletions
|
|
@ -99,7 +99,7 @@ final class OnnxRuntime {
|
|||
providers = initialiseProviders(ortApiHandle);
|
||||
loaded = true;
|
||||
} finally {
|
||||
if (!isAndroid()) {
|
||||
if (tempDirectory != null) {
|
||||
cleanUp(tempDirectory.toFile());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,7 +19,6 @@ import java.nio.ShortBuffer;
|
|||
* returned as outputs.
|
||||
*/
|
||||
public class OnnxTensor implements OnnxValue {
|
||||
|
||||
static {
|
||||
try {
|
||||
OnnxRuntime.init();
|
||||
|
|
@ -558,7 +557,6 @@ public class OnnxTensor implements OnnxValue {
|
|||
OrtEnvironment env, OrtAllocator allocator, ByteBuffer data, long[] shape, OnnxJavaType type)
|
||||
throws OrtException {
|
||||
if ((!env.isClosed()) && (!allocator.isClosed())) {
|
||||
int bufferSize = data.capacity();
|
||||
return createTensor(type, allocator, data, shape);
|
||||
} else {
|
||||
throw new IllegalStateException("Trying to create an OnnxTensor on a closed OrtAllocator.");
|
||||
|
|
|
|||
Loading…
Reference in a new issue