Skip to content

Commit

Permalink
estoy muy seco
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosuc3m committed Nov 23, 2024
1 parent efe7c4f commit b006f0b
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,14 @@ private static void buildFromTensorFloat(Tensor tensor, String memoryName) throw
throw new IllegalArgumentException("Model output tensor with shape " + Arrays.toString(arrayShape)
+ " is too big. Max number of elements per float output tensor supported: " + Integer.MAX_VALUE / 4);
SharedMemoryArray shma = SharedMemoryArray.readOrCreate(memoryName, arrayShape, new FloatType(), false, true);
long flatSize = 1;
/*long flatSize = 1;
for (long l : arrayShape) {flatSize *= l;}
ByteBuffer byteBuffer = ByteBuffer.allocate((int) (flatSize * Float.BYTES));
tensor.data_ptr_float().get(byteBuffer.asFloatBuffer().array());
shma.getDataBufferNoHeader().put(byteBuffer);
*/
RandomAccessibleInterval<?> rai = shma.getSharedRAI();
rai = ImgLib2Builder.build(tensor);
if (PlatformDetection.isWindows()) shma.close();
}

Expand Down

0 comments on commit b006f0b

Please sign in to comment.