Skip to content

Commit b6d3826

Browse files
committed
keep trying to display the output
1 parent 5765157 commit b6d3826

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

Diff for: src/main/java/io/bioimage/modelrunner/tensorflow/v1/shm/ShmBuilder.java

+2-6
Original file line numberDiff line numberDiff line change
@@ -124,14 +124,10 @@ private static void buildFromTensorFloat(Tensor<Float> tensor, String memoryName
124124
SharedMemoryArray shma = SharedMemoryArray.readOrCreate(memoryName, arrayShape, new FloatType(), false, true);
125125
ByteBuffer buff = shma.getDataBufferNoHeader();
126126
tensor.writeTo(buff);
127+
127128
try (FileOutputStream fos = new FileOutputStream("/home/carlos/git/interp_out" + UUID.randomUUID().toString() + ".npy");
128129
FileChannel fileChannel = fos.getChannel()) {
129-
buff.rewind();
130-
// Write the buffer's content to the file
131-
while (buff.hasRemaining()) {
132-
fileChannel.write(buff);
133-
}
134-
buff.rewind();
130+
fileChannel.write(ByteBuffer.wrap(tensor.bytesValue()));
135131
} catch (IOException e) {
136132
// TODO Auto-generated catch block
137133
e.printStackTrace();

0 commit comments

Comments
 (0)