Skip to content

Commit

Permalink
add more debugging prints
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosuc3m committed Dec 19, 2024
1 parent 62b4bd0 commit 2099e67
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import java.nio.charset.StandardCharsets;
import java.security.ProtectionDomain;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.LinkedList;
Expand Down Expand Up @@ -59,7 +60,6 @@
import io.bioimage.modelrunner.utils.CommonUtils;
import net.imglib2.Cursor;
import net.imglib2.RandomAccessibleInterval;
import net.imglib2.loops.LoopBuilder;
import net.imglib2.type.NativeType;
import net.imglib2.type.numeric.RealType;
import net.imglib2.util.Cast;
Expand Down Expand Up @@ -245,6 +245,7 @@ protected void runFromShmas(List<String> inputs, List<String> outputs) throws IO
IValueVector inputsVector = new IValueVector();
for (String ee : inputs) {
Map<String, Object> decoded = Types.decode(ee);
System.out.println("MM: -> " + ee);
SharedMemoryArray shma = SharedMemoryArray.read((String) decoded.get(MEM_NAME_KEY));
org.bytedeco.pytorch.Tensor inT = TensorBuilder.build(shma);
inputsVector.put(new IValue(inT));
Expand Down Expand Up @@ -320,6 +321,7 @@ else if (task.status == TaskStatus.CRASHED) {
shmaOutputList.add(shm);
}
RandomAccessibleInterval<T> rai = shm.getSharedRAI();
System.out.println("Output size: " + Arrays.asList(rai.dimensionsAsLongArray()));
// TODO remove
double max0 = 0;
Cursor<T> iter0 = Views.iterable(rai).cursor();
Expand Down Expand Up @@ -430,6 +432,7 @@ private <T extends RealType<T> & NativeType<T>> List<String> encodeInputs(List<T
List<String> encodedInputTensors = new ArrayList<String>();
Gson gson = new Gson();
for (Tensor<T> tt : inputTensors) {
System.out.println("Input size: " + Arrays.asList(tt.getData().dimensionsAsLongArray()));
SharedMemoryArray shma = SharedMemoryArray.createSHMAFromRAI(tt.getData(), false, true);
shmaInputList.add(shma);
HashMap<String, Object> map = new HashMap<String, Object>();
Expand Down

0 comments on commit 2099e67

Please sign in to comment.