@@ -93,7 +93,7 @@ private static void buildFromTensorUByte(Tensor<UInt8> tensor, String memoryName
93
93
throw new IllegalArgumentException ("Model output tensor with shape " + Arrays .toString (arrayShape )
94
94
+ " is too big. Max number of elements per ubyte output tensor supported: " + Integer .MAX_VALUE / 1 );
95
95
SharedMemoryArray shma = SharedMemoryArray .readOrCreate (memoryName , arrayShape , new UnsignedByteType (), false , true );
96
- ByteBuffer buff = shma .getDataBuffer ();
96
+ ByteBuffer buff = shma .getDataBufferNoHeader ();
97
97
tensor .writeTo (buff );
98
98
if (PlatformDetection .isWindows ()) shma .close ();
99
99
}
@@ -106,7 +106,7 @@ private static void buildFromTensorInt(Tensor<Integer> tensor, String memoryName
106
106
+ " is too big. Max number of elements per int output tensor supported: " + Integer .MAX_VALUE / 4 );
107
107
108
108
SharedMemoryArray shma = SharedMemoryArray .readOrCreate (memoryName , arrayShape , new IntType (), false , true );
109
- ByteBuffer buff = shma .getDataBuffer ();
109
+ ByteBuffer buff = shma .getDataBufferNoHeader ();
110
110
tensor .writeTo (buff );
111
111
if (PlatformDetection .isWindows ()) shma .close ();
112
112
}
@@ -119,7 +119,7 @@ private static void buildFromTensorFloat(Tensor<Float> tensor, String memoryName
119
119
+ " is too big. Max number of elements per float output tensor supported: " + Integer .MAX_VALUE / 4 );
120
120
121
121
SharedMemoryArray shma = SharedMemoryArray .readOrCreate (memoryName , arrayShape , new FloatType (), false , true );
122
- ByteBuffer buff = shma .getDataBuffer ();
122
+ ByteBuffer buff = shma .getDataBufferNoHeader ();
123
123
tensor .writeTo (buff );
124
124
if (PlatformDetection .isWindows ()) shma .close ();
125
125
}
@@ -132,7 +132,7 @@ private static void buildFromTensorDouble(Tensor<Double> tensor, String memoryNa
132
132
+ " is too big. Max number of elements per double output tensor supported: " + Integer .MAX_VALUE / 8 );
133
133
134
134
SharedMemoryArray shma = SharedMemoryArray .readOrCreate (memoryName , arrayShape , new DoubleType (), false , true );
135
- ByteBuffer buff = shma .getDataBuffer ();
135
+ ByteBuffer buff = shma .getDataBufferNoHeader ();
136
136
tensor .writeTo (buff );
137
137
if (PlatformDetection .isWindows ()) shma .close ();
138
138
}
@@ -146,7 +146,7 @@ private static void buildFromTensorLong(Tensor<Long> tensor, String memoryName)
146
146
147
147
148
148
SharedMemoryArray shma = SharedMemoryArray .readOrCreate (memoryName , arrayShape , new LongType (), false , true );
149
- ByteBuffer buff = shma .getDataBuffer ();
149
+ ByteBuffer buff = shma .getDataBufferNoHeader ();
150
150
tensor .writeTo (buff );
151
151
if (PlatformDetection .isWindows ()) shma .close ();
152
152
}
0 commit comments