@@ -88,7 +88,7 @@ private static void buildFromTensorUByte(NDArray tensor, String memoryName) thro
88
88
if (CommonUtils .int32Overflows (arrayShape , 1 ))
89
89
throw new IllegalArgumentException ("Model output tensor with shape " + Arrays .toString (arrayShape )
90
90
+ " is too big. Max number of elements per ubyte output tensor supported: " + Integer .MAX_VALUE / 1 );
91
- SharedMemoryArray shma = SharedMemoryArray .readOrCreate (memoryName , arrayShape , new UnsignedByteType (), false , true );
91
+ SharedMemoryArray shma = SharedMemoryArray .readOrCreate (memoryName , arrayShape , new UnsignedByteType (), true , true );
92
92
shma .getDataBufferNoHeader ().put (tensor .toByteArray ());
93
93
if (PlatformDetection .isWindows ()) shma .close ();
94
94
}
@@ -100,7 +100,7 @@ private static void buildFromTensorInt(NDArray tensor, String memoryName) throws
100
100
throw new IllegalArgumentException ("Model output tensor with shape " + Arrays .toString (arrayShape )
101
101
+ " is too big. Max number of elements per int output tensor supported: " + Integer .MAX_VALUE / 4 );
102
102
103
- SharedMemoryArray shma = SharedMemoryArray .readOrCreate (memoryName , arrayShape , new IntType (), false , true );
103
+ SharedMemoryArray shma = SharedMemoryArray .readOrCreate (memoryName , arrayShape , new IntType (), true , true );
104
104
shma .getDataBufferNoHeader ().put (tensor .toByteArray ());
105
105
if (PlatformDetection .isWindows ()) shma .close ();
106
106
}
@@ -112,7 +112,7 @@ private static void buildFromTensorFloat(NDArray tensor, String memoryName) thro
112
112
throw new IllegalArgumentException ("Model output tensor with shape " + Arrays .toString (arrayShape )
113
113
+ " is too big. Max number of elements per float output tensor supported: " + Integer .MAX_VALUE / 4 );
114
114
115
- SharedMemoryArray shma = SharedMemoryArray .readOrCreate (memoryName , arrayShape , new FloatType (), false , true );
115
+ SharedMemoryArray shma = SharedMemoryArray .readOrCreate (memoryName , arrayShape , new FloatType (), true , true );
116
116
shma .getDataBufferNoHeader ().put (tensor .toByteArray ());
117
117
if (PlatformDetection .isWindows ()) shma .close ();
118
118
}
@@ -124,7 +124,7 @@ private static void buildFromTensorDouble(NDArray tensor, String memoryName) thr
124
124
throw new IllegalArgumentException ("Model output tensor with shape " + Arrays .toString (arrayShape )
125
125
+ " is too big. Max number of elements per double output tensor supported: " + Integer .MAX_VALUE / 8 );
126
126
127
- SharedMemoryArray shma = SharedMemoryArray .readOrCreate (memoryName , arrayShape , new DoubleType (), false , true );
127
+ SharedMemoryArray shma = SharedMemoryArray .readOrCreate (memoryName , arrayShape , new DoubleType (), true , true );
128
128
shma .getDataBufferNoHeader ().put (tensor .toByteArray ());
129
129
if (PlatformDetection .isWindows ()) shma .close ();
130
130
}
@@ -137,7 +137,7 @@ private static void buildFromTensorLong(NDArray tensor, String memoryName) throw
137
137
+ " is too big. Max number of elements per long output tensor supported: " + Integer .MAX_VALUE / 8 );
138
138
139
139
140
- SharedMemoryArray shma = SharedMemoryArray .readOrCreate (memoryName , arrayShape , new LongType (), false , true );
140
+ SharedMemoryArray shma = SharedMemoryArray .readOrCreate (memoryName , arrayShape , new LongType (), true , true );
141
141
shma .getDataBufferNoHeader ().put (tensor .toByteArray ());
142
142
if (PlatformDetection .isWindows ()) shma .close ();
143
143
}
0 commit comments