Skip to content

Commit

Permalink
add prints everywhere
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosuc3m committed Nov 23, 2024
1 parent de260bd commit 76cfc77
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -253,8 +253,10 @@ protected void runFromShmas(List<String> inputs, List<String> outputs) throws IO
IValue output = model.forward(inputsVector);
TensorVector outputTensorVector = null;
if (output.isTensorList()) {
System.out.println("SSECRET_KEY : 1 ");
outputTensorVector = output.toTensorVector();
} else {
System.out.println("SSECRET_KEY : 2 ");
outputTensorVector = new TensorVector();
outputTensorVector.put(output.toTensor());
}
Expand All @@ -263,6 +265,7 @@ protected void runFromShmas(List<String> inputs, List<String> outputs) throws IO
int c = 0;
for (String ee : outputs) {
Map<String, Object> decoded = Types.decode(ee);
System.out.println("ENTERED: " + ee);
ShmBuilder.build(outputTensorVector.get(c ++), (String) decoded.get(MEM_NAME_KEY));
}
outputTensorVector.close();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,19 @@ public static void build(Tensor tensor, String memoryName) throws IllegalArgumen
{
if (tensor.dtype().isScalarType(org.bytedeco.pytorch.global.torch.ScalarType.Byte)
|| tensor.dtype().isScalarType(org.bytedeco.pytorch.global.torch.ScalarType.Char)) {
System.out.println("SSECRET_KEY : BYTE ");
buildFromTensorByte(tensor, memoryName);
} else if (tensor.dtype().isScalarType(org.bytedeco.pytorch.global.torch.ScalarType.Int)) {
System.out.println("SSECRET_KEY : INT ");
buildFromTensorInt(tensor, memoryName);
} else if (tensor.dtype().isScalarType(org.bytedeco.pytorch.global.torch.ScalarType.Float)) {
System.out.println("SSECRET_KEY : FLOAT ");
buildFromTensorFloat(tensor, memoryName);
} else if (tensor.dtype().isScalarType(org.bytedeco.pytorch.global.torch.ScalarType.Double)) {
System.out.println("SSECRET_KEY : SOUBKE ");
buildFromTensorDouble(tensor, memoryName);
} else if (tensor.dtype().isScalarType(org.bytedeco.pytorch.global.torch.ScalarType.Long)) {
System.out.println("SSECRET_KEY : LONG ");
buildFromTensorLong(tensor, memoryName);
} else {
throw new IllegalArgumentException("Unsupported tensor type: " + tensor.scalar_type());
Expand Down

0 comments on commit 76cfc77

Please sign in to comment.