Skip to content

Commit b006f0b

Browse files
committedNov 23, 2024·
estoy muy seco
1 parent efe7c4f commit b006f0b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed
 

‎src/main/java/io/bioimage/modelrunner/pytorch/javacpp/shm/ShmBuilder.java

+4-1
Original file line numberDiff line numberDiff line change
@@ -111,11 +111,14 @@ private static void buildFromTensorFloat(Tensor tensor, String memoryName) throw
111111
throw new IllegalArgumentException("Model output tensor with shape " + Arrays.toString(arrayShape)
112112
+ " is too big. Max number of elements per float output tensor supported: " + Integer.MAX_VALUE / 4);
113113
SharedMemoryArray shma = SharedMemoryArray.readOrCreate(memoryName, arrayShape, new FloatType(), false, true);
114-
long flatSize = 1;
114+
/*long flatSize = 1;
115115
for (long l : arrayShape) {flatSize *= l;}
116116
ByteBuffer byteBuffer = ByteBuffer.allocate((int) (flatSize * Float.BYTES));
117117
tensor.data_ptr_float().get(byteBuffer.asFloatBuffer().array());
118118
shma.getDataBufferNoHeader().put(byteBuffer);
119+
*/
120+
RandomAccessibleInterval<?> rai = shma.getSharedRAI();
121+
rai = ImgLib2Builder.build(tensor);
119122
if (PlatformDetection.isWindows()) shma.close();
120123
}
121124

0 commit comments

Comments
 (0)
Please sign in to comment.