Skip to content

Commit 7048395

Browse files
committed
remove stupid cast
1 parent f2c3e15 commit 7048395

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

src/main/java/io/bioimage/modelrunner/pytorch/javacpp/shm/TensorBuilder.java

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,6 @@
2323

2424
import io.bioimage.modelrunner.tensor.shm.SharedMemoryArray;
2525
import io.bioimage.modelrunner.utils.CommonUtils;
26-
import net.imglib2.Cursor;
27-
import net.imglib2.util.Cast;
28-
import net.imglib2.view.Views;
2926

3027
import java.nio.ByteBuffer;
3128
import java.util.Arrays;
@@ -58,19 +55,19 @@ public static Tensor build(SharedMemoryArray array) throws IllegalArgumentExcept
5855
{
5956
// Create an Icy sequence of the same type of the tensor
6057
if (array.getOriginalDataType().equals("int8")) {
61-
return buildByte(Cast.unchecked(array));
58+
return buildByte(array);
6259
}
6360
else if (array.getOriginalDataType().equals("int32")) {
64-
return buildInt(Cast.unchecked(array));
61+
return buildInt(array);
6562
}
6663
else if (array.getOriginalDataType().equals("float32")) {
67-
return buildFloat(Cast.unchecked(array));
64+
return buildFloat(array);
6865
}
6966
else if (array.getOriginalDataType().equals("float64")) {
70-
return buildDouble(Cast.unchecked(array));
67+
return buildDouble(array);
7168
}
7269
else if (array.getOriginalDataType().equals("int64")) {
73-
return buildLong(Cast.unchecked(array));
70+
return buildLong(array);
7471
}
7572
else {
7673
throw new IllegalArgumentException("Unsupported tensor type: " + array.getOriginalDataType());

0 commit comments

Comments
 (0)