Skip to content

Commit 76cfc77

Browse files
committedNov 23, 2024·
add prints everywhere
1 parent de260bd commit 76cfc77

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed
 

‎src/main/java/io/bioimage/modelrunner/pytorch/javacpp/PytorchJavaCPPInterface.java

+3
Original file line numberDiff line numberDiff line change
@@ -253,8 +253,10 @@ protected void runFromShmas(List<String> inputs, List<String> outputs) throws IO
253253
IValue output = model.forward(inputsVector);
254254
TensorVector outputTensorVector = null;
255255
if (output.isTensorList()) {
256+
System.out.println("SSECRET_KEY : 1 ");
256257
outputTensorVector = output.toTensorVector();
257258
} else {
259+
System.out.println("SSECRET_KEY : 2 ");
258260
outputTensorVector = new TensorVector();
259261
outputTensorVector.put(output.toTensor());
260262
}
@@ -263,6 +265,7 @@ protected void runFromShmas(List<String> inputs, List<String> outputs) throws IO
263265
int c = 0;
264266
for (String ee : outputs) {
265267
Map<String, Object> decoded = Types.decode(ee);
268+
System.out.println("ENTERED: " + ee);
266269
ShmBuilder.build(outputTensorVector.get(c ++), (String) decoded.get(MEM_NAME_KEY));
267270
}
268271
outputTensorVector.close();

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

+5
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,19 @@ public static void build(Tensor tensor, String memoryName) throws IllegalArgumen
6868
{
6969
if (tensor.dtype().isScalarType(org.bytedeco.pytorch.global.torch.ScalarType.Byte)
7070
|| tensor.dtype().isScalarType(org.bytedeco.pytorch.global.torch.ScalarType.Char)) {
71+
System.out.println("SSECRET_KEY : BYTE ");
7172
buildFromTensorByte(tensor, memoryName);
7273
} else if (tensor.dtype().isScalarType(org.bytedeco.pytorch.global.torch.ScalarType.Int)) {
74+
System.out.println("SSECRET_KEY : INT ");
7375
buildFromTensorInt(tensor, memoryName);
7476
} else if (tensor.dtype().isScalarType(org.bytedeco.pytorch.global.torch.ScalarType.Float)) {
77+
System.out.println("SSECRET_KEY : FLOAT ");
7578
buildFromTensorFloat(tensor, memoryName);
7679
} else if (tensor.dtype().isScalarType(org.bytedeco.pytorch.global.torch.ScalarType.Double)) {
80+
System.out.println("SSECRET_KEY : SOUBKE ");
7781
buildFromTensorDouble(tensor, memoryName);
7882
} else if (tensor.dtype().isScalarType(org.bytedeco.pytorch.global.torch.ScalarType.Long)) {
83+
System.out.println("SSECRET_KEY : LONG ");
7984
buildFromTensorLong(tensor, memoryName);
8085
} else {
8186
throw new IllegalArgumentException("Unsupported tensor type: " + tensor.scalar_type());

0 commit comments

Comments
 (0)
Please sign in to comment.