Skip to content

Commit a4eeaf9

Browse files
committed
correct compilation error
1 parent fc3fc86 commit a4eeaf9

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/main/java/io/bioimage/modelrunner/tensorflow/v2/api050/tensor/TensorBuilder.java

+6-5
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
import net.imglib2.type.numeric.integer.UnsignedByteType;
3434
import net.imglib2.type.numeric.real.DoubleType;
3535
import net.imglib2.type.numeric.real.FloatType;
36+
import net.imglib2.util.Cast;
3637
import net.imglib2.util.Util;
3738
import net.imglib2.view.Views;
3839

@@ -104,19 +105,19 @@ public static < T extends RealType< T > & NativeType< T > > TType build(
104105
{
105106
// Create an Icy sequence of the same type of the tensor
106107
if (Util.getTypeFromInterval(array) instanceof UnsignedByteType) {
107-
return buildUByte((RandomAccessibleInterval<UnsignedByteType>) array);
108+
return buildUByte(Cast.unchecked(array));
108109
}
109110
else if (Util.getTypeFromInterval(array) instanceof IntType) {
110-
return buildInt((RandomAccessibleInterval<IntType>) array);
111+
return buildInt(Cast.unchecked(array));
111112
}
112113
else if (Util.getTypeFromInterval(array) instanceof FloatType) {
113-
return buildFloat((RandomAccessibleInterval<FloatType>) array);
114+
return buildFloat(Cast.unchecked(array));
114115
}
115116
else if (Util.getTypeFromInterval(array) instanceof DoubleType) {
116-
return buildDouble((RandomAccessibleInterval<DoubleType>) array);
117+
return buildDouble(Cast.unchecked(array));
117118
}
118119
else if (Util.getTypeFromInterval(array) instanceof LongType) {
119-
return buildLong((RandomAccessibleInterval<LongType>) array);
120+
return buildLong(Cast.unchecked(array));
120121
}
121122
else {
122123
throw new IllegalArgumentException("Unsupported tensor type: " + Util

0 commit comments

Comments
 (0)