Skip to content

Commit d123975

Browse files
committed
improve javadoc
1 parent 45bc153 commit d123975

File tree

3 files changed

+8
-86
lines changed

3 files changed

+8
-86
lines changed

Diff for: src/main/java/io/bioimage/modelrunner/tensorflow/v2/api020/JavaWorker.java

+7-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,13 @@ public class JavaWorker {
2121
private final Tensorflow2Interface ti;
2222

2323
private boolean cancelRequested = false;
24-
24+
25+
/**
26+
* Method in the child process that is in charge of keeping the process open and calling the model load,
27+
* model inference and model closing
28+
* @param args
29+
* args of the parent process
30+
*/
2531
public static void main(String[] args) {
2632

2733
try(Scanner scanner = new Scanner(System.in)){

Diff for: src/main/java/io/bioimage/modelrunner/tensorflow/v2/api020/tensor/ImgLib2Builder.java

-35
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,6 @@ public static <T extends Type<T>> RandomAccessibleInterval<T> build(Tensor<? ext
8787
}
8888
}
8989

90-
/**
91-
* Builds a {@link RandomAccessibleInterval} from a unsigned byte-typed {@link TUint8} tensor.
92-
*
93-
* @param tensor
94-
* The {@link TUint8} tensor data is read from.
95-
* @return The {@link RandomAccessibleInterval} built from the tensor, of type {@link UnsignedByteType}.
96-
*/
9790
private static RandomAccessibleInterval<UnsignedByteType> buildFromTensorUByte(Tensor<TUint8> tensor)
9891
{
9992
long[] arrayShape = tensor.shape().asArray();
@@ -110,13 +103,6 @@ private static RandomAccessibleInterval<UnsignedByteType> buildFromTensorUByte(T
110103
return Utils.transpose(rai);
111104
}
112105

113-
/**
114-
* Builds a {@link RandomAccessibleInterval} from a unsigned int32-typed {@link TInt32} tensor.
115-
*
116-
* @param tensor
117-
* The {@link TInt32} tensor data is read from.
118-
* @return The {@link RandomAccessibleInterval} built from the tensor, of type {@link IntType}.
119-
*/
120106
private static RandomAccessibleInterval<IntType> buildFromTensorInt(Tensor<TInt32> tensor)
121107
{
122108
long[] arrayShape = tensor.shape().asArray();
@@ -133,13 +119,6 @@ private static RandomAccessibleInterval<IntType> buildFromTensorInt(Tensor<TInt3
133119
return Utils.transpose(rai);
134120
}
135121

136-
/**
137-
* Builds a {@link RandomAccessibleInterval} from a unsigned float32-typed {@link TFloat32} tensor.
138-
*
139-
* @param tensor
140-
* The {@link TFloat32} tensor data is read from.
141-
* @return The {@link RandomAccessibleInterval} built from the tensor, of type {@link FloatType}.
142-
*/
143122
private static RandomAccessibleInterval<FloatType> buildFromTensorFloat(Tensor<TFloat32> tensor)
144123
{
145124
long[] arrayShape = tensor.shape().asArray();
@@ -156,13 +135,6 @@ private static RandomAccessibleInterval<FloatType> buildFromTensorFloat(Tensor<T
156135
return Utils.transpose(rai);
157136
}
158137

159-
/**
160-
* Builds a {@link RandomAccessibleInterval} from a unsigned float64-typed {@link TFloat64} tensor.
161-
*
162-
* @param tensor
163-
* The {@link TFloat64} tensor data is read from.
164-
* @return The {@link RandomAccessibleInterval} built from the tensor, of type {@link DoubleType}.
165-
*/
166138
private static RandomAccessibleInterval<DoubleType> buildFromTensorDouble(Tensor<TFloat64> tensor)
167139
{
168140
long[] arrayShape = tensor.shape().asArray();
@@ -179,13 +151,6 @@ private static RandomAccessibleInterval<DoubleType> buildFromTensorDouble(Tensor
179151
return Utils.transpose(rai);
180152
}
181153

182-
/**
183-
* Builds a {@link RandomAccessibleInterval} from a unsigned int64-typed {@link TInt64} tensor.
184-
*
185-
* @param tensor
186-
* The {@link TInt64} tensor data is read from.
187-
* @return The {@link RandomAccessibleInterval} built from the tensor, of type {@link LongType}.
188-
*/
189154
private static RandomAccessibleInterval<LongType> buildFromTensorLong(Tensor<TInt64> tensor)
190155
{
191156
long[] arrayShape = tensor.shape().asArray();

Diff for: src/main/java/io/bioimage/modelrunner/tensorflow/v2/api020/tensor/TensorBuilder.java

+1-50
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ Tensor<? extends TType> build(
9999
* @throws IllegalArgumentException if the type of the {@link RandomAccessibleInterval}
100100
* is not supported
101101
*/
102+
@SuppressWarnings("unchecked")
102103
public static <T extends Type<T>> Tensor<? extends TType> build(
103104
RandomAccessibleInterval<T> array) throws IllegalArgumentException
104105
{
@@ -123,16 +124,6 @@ else if (Util.getTypeFromInterval(array) instanceof LongType) {
123124
}
124125
}
125126

126-
/**
127-
* Creates a {@link Tensor} of type {@link TUint8} from an
128-
* {@link RandomAccessibleInterval} of type {@link UnsignedByteType}
129-
*
130-
* @param tensor
131-
* The {@link RandomAccessibleInterval} to fill the tensor with.
132-
* @return The {@link Tensor} tensor filled with the {@link RandomAccessibleInterval} data.
133-
* @throws IllegalArgumentException if the input {@link RandomAccessibleInterval} type is
134-
* not compatible
135-
*/
136127
private static Tensor<TUint8> buildUByte(
137128
RandomAccessibleInterval<UnsignedByteType> tensor)
138129
throws IllegalArgumentException
@@ -161,16 +152,6 @@ private static Tensor<TUint8> buildUByte(
161152
return ndarray;
162153
}
163154

164-
/**
165-
* Creates a {@link Tensor} of type {@link TInt32} from an
166-
* {@link RandomAccessibleInterval} of type {@link IntType}
167-
*
168-
* @param tensor
169-
* The {@link RandomAccessibleInterval} to fill the tensor with.
170-
* @return The {@link Tensor} tensor filled with the {@link RandomAccessibleInterval} data.
171-
* @throws IllegalArgumentException if the input {@link RandomAccessibleInterval} type is
172-
* not compatible
173-
*/
174155
private static Tensor<TInt32> buildInt(
175156
RandomAccessibleInterval<IntType> tensor) throws IllegalArgumentException
176157
{
@@ -198,16 +179,6 @@ private static Tensor<TInt32> buildInt(
198179
return ndarray;
199180
}
200181

201-
/**
202-
* Creates a {@link Tensor} of type {@link TInt64} from an
203-
* {@link RandomAccessibleInterval} of type {@link LongType}
204-
*
205-
* @param tensor
206-
* The {@link RandomAccessibleInterval} to fill the tensor with.
207-
* @return The {@link Tensor} tensor filled with the {@link RandomAccessibleInterval} data.
208-
* @throws IllegalArgumentException if the input {@link RandomAccessibleInterval} type is
209-
* not compatible
210-
*/
211182
private static Tensor<TInt64> buildLong(
212183
RandomAccessibleInterval<LongType> tensor)
213184
throws IllegalArgumentException
@@ -236,16 +207,6 @@ private static Tensor<TInt64> buildLong(
236207
return ndarray;
237208
}
238209

239-
/**
240-
* Creates a {@link Tensor} of type {@link TFloat32} from an
241-
* {@link RandomAccessibleInterval} of type {@link FloatType}
242-
*
243-
* @param tensor
244-
* The {@link RandomAccessibleInterval} to fill the tensor with.
245-
* @return The {@link Tensor} tensor filled with the {@link RandomAccessibleInterval} data.
246-
* @throws IllegalArgumentException if the input {@link RandomAccessibleInterval} type is
247-
* not compatible
248-
*/
249210
private static Tensor<TFloat32> buildFloat(
250211
RandomAccessibleInterval<FloatType> tensor)
251212
throws IllegalArgumentException
@@ -274,16 +235,6 @@ private static Tensor<TFloat32> buildFloat(
274235
return ndarray;
275236
}
276237

277-
/**
278-
* Creates a {@link Tensor} of type {@link TFloat64} from an
279-
* {@link RandomAccessibleInterval} of type {@link DoubleType}
280-
*
281-
* @param tensor
282-
* The {@link RandomAccessibleInterval} to fill the tensor with.
283-
* @return The {@link Tensor} tensor filled with the {@link RandomAccessibleInterval} data.
284-
* @throws IllegalArgumentException if the input {@link RandomAccessibleInterval} type is
285-
* not compatible
286-
*/
287238
private static Tensor<TFloat64> buildDouble(
288239
RandomAccessibleInterval<DoubleType> tensor)
289240
throws IllegalArgumentException

0 commit comments

Comments
 (0)