Skip to content

Commit

Permalink
remove stupid cast
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosuc3m committed Dec 19, 2024
1 parent f2c3e15 commit 7048395
Showing 1 changed file with 5 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@

import io.bioimage.modelrunner.tensor.shm.SharedMemoryArray;
import io.bioimage.modelrunner.utils.CommonUtils;
import net.imglib2.Cursor;
import net.imglib2.util.Cast;
import net.imglib2.view.Views;

import java.nio.ByteBuffer;
import java.util.Arrays;
Expand Down Expand Up @@ -58,19 +55,19 @@ public static Tensor build(SharedMemoryArray array) throws IllegalArgumentExcept
{
// Create an Icy sequence of the same type of the tensor
if (array.getOriginalDataType().equals("int8")) {
return buildByte(Cast.unchecked(array));
return buildByte(array);
}
else if (array.getOriginalDataType().equals("int32")) {
return buildInt(Cast.unchecked(array));
return buildInt(array);
}
else if (array.getOriginalDataType().equals("float32")) {
return buildFloat(Cast.unchecked(array));
return buildFloat(array);
}
else if (array.getOriginalDataType().equals("float64")) {
return buildDouble(Cast.unchecked(array));
return buildDouble(array);
}
else if (array.getOriginalDataType().equals("int64")) {
return buildLong(Cast.unchecked(array));
return buildLong(array);
}
else {
throw new IllegalArgumentException("Unsupported tensor type: " + array.getOriginalDataType());
Expand Down

0 comments on commit 7048395

Please sign in to comment.