Skip to content

Commit 67df3c1

Browse files
committed
correct javadoc
1 parent dc6b0e2 commit 67df3c1

File tree

2 files changed

+1
-59
lines changed

2 files changed

+1
-59
lines changed

src/main/java/io/bioimage/modelrunner/tensorflow/v1/tensor/ImgLib2Builder.java

-25
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
import java.util.Arrays;
3131

3232
import net.imglib2.RandomAccessibleInterval;
33-
import net.imglib2.img.Img;
3433
import net.imglib2.img.array.ArrayImgs;
3534
import net.imglib2.type.Type;
3635
import net.imglib2.type.numeric.integer.IntType;
@@ -83,12 +82,6 @@ public static < T extends Type< T > > RandomAccessibleInterval<T> build(Tensor<
8382
}
8483
}
8584

86-
/**
87-
* Builds a {@link RandomAccessibleInterval} from a unsigned byte-typed {@link Tensor}.
88-
*
89-
* @param tensor The tensor data is read from.
90-
* @return The RandomAccessibleInterval built from the tensor, of type {@link UnsignedByteType}.
91-
*/
9285
private static RandomAccessibleInterval<UnsignedByteType> buildFromTensorUByte(Tensor<UInt8> tensor) {
9386
long[] arrayShape = tensor.shape();
9487
if (CommonUtils.int32Overflows(arrayShape, 1))
@@ -106,12 +99,6 @@ private static RandomAccessibleInterval<UnsignedByteType> buildFromTensorUByte(T
10699
return Utils.transpose(rai);
107100
}
108101

109-
/**
110-
* Builds a {@link RandomAccessibleInterval} from a unsigned integer-typed {@link Tensor}.
111-
*
112-
* @param tensor The tensor data is read from.
113-
* @return The RandomAccessibleInterval built from the tensor, of type {@link IntType}.
114-
*/
115102
private static RandomAccessibleInterval<IntType> buildFromTensorInt(Tensor<Integer> tensor) {
116103
long[] arrayShape = tensor.shape();
117104
if (CommonUtils.int32Overflows(arrayShape, 4))
@@ -129,12 +116,6 @@ private static RandomAccessibleInterval<IntType> buildFromTensorInt(Tensor<Integ
129116
return Utils.transpose(rai);
130117
}
131118

132-
/**
133-
* Builds a {@link RandomAccessibleInterval} from a unsigned float-typed {@link Tensor}.
134-
*
135-
* @param tensor The tensor data is read from.
136-
* @return The RandomAccessibleInterval built from the tensor, of type {@link FloatType}.
137-
*/
138119
private static RandomAccessibleInterval<FloatType> buildFromTensorFloat(Tensor<Float> tensor) {
139120
long[] arrayShape = tensor.shape();
140121
if (CommonUtils.int32Overflows(arrayShape, 4))
@@ -152,12 +133,6 @@ private static RandomAccessibleInterval<FloatType> buildFromTensorFloat(Tensor<F
152133
return Utils.transpose(rai);
153134
}
154135

155-
/**
156-
* Builds a {@link RandomAccessibleInterval} from a unsigned double-typed {@link Tensor}.
157-
*
158-
* @param tensor The tensor data is read from.
159-
* @return The RandomAccessibleInterval built from the tensor, of type {@link DoubleType}.
160-
*/
161136
private static RandomAccessibleInterval<DoubleType> buildFromTensorDouble(Tensor<Double> tensor) {
162137
long[] arrayShape = tensor.shape();
163138
if (CommonUtils.int32Overflows(arrayShape, 8))

src/main/java/io/bioimage/modelrunner/tensorflow/v1/tensor/TensorBuilder.java

+1-34
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,9 @@
3131

3232
import net.imglib2.Cursor;
3333
import net.imglib2.RandomAccessibleInterval;
34-
import net.imglib2.blocks.PrimitiveBlocks;
3534
import net.imglib2.img.Img;
3635
import net.imglib2.type.NativeType;
3736
import net.imglib2.type.numeric.RealType;
38-
import net.imglib2.type.numeric.integer.ByteType;
3937
import net.imglib2.type.numeric.integer.IntType;
4038
import net.imglib2.type.numeric.integer.UnsignedByteType;
4139
import net.imglib2.type.numeric.real.DoubleType;
@@ -82,6 +80,7 @@ Tensor<?> build(io.bioimage.modelrunner.tensor.Tensor<T> tensor) {
8280
* @return The tensor created from the sequence.
8381
* @throws IllegalArgumentException If the {@link RandomAccessibleInterval} dtype is not supported.
8482
*/
83+
@SuppressWarnings("unchecked")
8584
public static Tensor<?> build(RandomAccessibleInterval<?> rai)
8685
{
8786
if (Util.getTypeFromInterval(rai) instanceof UnsignedByteType) {
@@ -102,14 +101,6 @@ else if (Util.getTypeFromInterval(rai) instanceof DoubleType) {
102101
}
103102
}
104103

105-
/**
106-
* Creates a unsigned byte-typed {@link Tensor} based on the provided
107-
* {@link RandomAccessibleInterval} and the desired dimension order for the
108-
* resulting tensor.
109-
*
110-
* @param tensor The {@link RandomAccessibleInterval} to be converted.
111-
* @return The {@link Tensor} created from the sequence.
112-
*/
113104
private static Tensor<UInt8> buildUByte(
114105
RandomAccessibleInterval<UnsignedByteType> tensor)
115106
{
@@ -137,14 +128,6 @@ private static Tensor<UInt8> buildUByte(
137128
return ndarray;
138129
}
139130

140-
/**
141-
* Creates a integer-typed {@link Tensor} based on the provided
142-
* {@link RandomAccessibleInterval} and the desired dimension order for the
143-
* resulting tensor.
144-
*
145-
* @param tensor The {@link RandomAccessibleInterval} to be converted.
146-
* @return The {@link Tensor} created from the sequence.
147-
*/
148131
private static Tensor<Integer> buildInt(
149132
RandomAccessibleInterval<IntType> tensor)
150133
{
@@ -172,14 +155,6 @@ private static Tensor<Integer> buildInt(
172155
return ndarray;
173156
}
174157

175-
/**
176-
* Creates a float-typed {@link Tensor} based on the provided
177-
* {@link RandomAccessibleInterval} and the desired dimension order for the
178-
* resulting tensor.
179-
*
180-
* @param tensor The {@link RandomAccessibleInterval} to be converted.
181-
* @return The {@link Tensor} created from the sequence.
182-
*/
183158
private static Tensor<Float> buildFloat(
184159
RandomAccessibleInterval<FloatType> tensor)
185160
{
@@ -207,14 +182,6 @@ private static Tensor<Float> buildFloat(
207182
return ndarray;
208183
}
209184

210-
/**
211-
* Creates a double-typed {@link Tensor} based on the provided
212-
* {@link RandomAccessibleInterval} and the desired dimension order for the
213-
* resulting tensor.
214-
*
215-
* @param tensor The {@link RandomAccessibleInterval} to be converted.
216-
* @return The {@link Tensor} created from the sequence.
217-
*/
218185
private static Tensor<Double> buildDouble(
219186
RandomAccessibleInterval<DoubleType> tensor)
220187
{

0 commit comments

Comments
 (0)