Skip to content

Commit c35f367

Browse files
committed
remove more casting errors that fail at compilation
1 parent 1d80600 commit c35f367

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

src/main/java/io/bioimage/modelrunner/example/ExampleLoadAndRunModel.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,8 @@ void main(String[] args) throws LoadEngineException, Exception {
112112
// Create the input tensor with the nameand axes given by the rdf.yaml file
113113
// and add it to the list of input tensors
114114
Tensor<FloatType> inpTensor = Tensor.build("input0", "bcyx", img1);
115-
List<Tensor<T>> inputs = new ArrayList<Tensor<T>>();
116-
inputs.add((Tensor<T>) inpTensor);
115+
List<Tensor<FloatType>> inputs = new ArrayList<Tensor<FloatType>>();
116+
inputs.add(inpTensor);
117117

118118
// Create the output tensors defined in the rdf.yaml file with their corresponding
119119
// name and axes and add them to the output list of tensors.
@@ -126,8 +126,8 @@ void main(String[] args) throws LoadEngineException, Exception {
126126
new FloatType());*/
127127
final Img< FloatType > img2 = imgFactory.create( 1, 2, 512, 512 );
128128
Tensor<FloatType> outTensor = Tensor.build("output0", "bcyx", img2);
129-
List<Tensor<R>> outputs = new ArrayList<Tensor<R>>();
130-
outputs.add((Tensor<R>) outTensor);
129+
List<Tensor<FloatType>> outputs = new ArrayList<Tensor<FloatType>>();
130+
outputs.add(outTensor);
131131

132132
// Run the model on the input tensors. THe output tensors
133133
// will be rewritten with the result of the execution

src/main/java/io/bioimage/modelrunner/example/ExampleLoadPytorch1Pytorch2.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,8 @@ void loadAndRunPt2(String modelFolder, String modelSource) throws LoadEngineExce
126126
// Create the input tensor with the nameand axes given by the rdf.yaml file
127127
// and add it to the list of input tensors
128128
Tensor<FloatType> inpTensor = Tensor.build("input0", "bcyx", img1);
129-
List<Tensor<T>> inputs = new ArrayList<Tensor<T>>();
130-
inputs.add((Tensor<T>) inpTensor);
129+
List<Tensor<FloatType>> inputs = new ArrayList<Tensor<FloatType>>();
130+
inputs.add(inpTensor);
131131

132132
// Create the output tensors defined in the rdf.yaml file with their corresponding
133133
// name and axes and add them to the output list of tensors.
@@ -140,8 +140,8 @@ void loadAndRunPt2(String modelFolder, String modelSource) throws LoadEngineExce
140140
new FloatType());*/
141141
final Img< FloatType > img2 = imgFactory.create( 1, 2, 512, 512 );
142142
Tensor<FloatType> outTensor = Tensor.build("output0", "bcyx", img2);
143-
List<Tensor<R>> outputs = new ArrayList<Tensor<R>>();
144-
outputs.add((Tensor<R>) outTensor);
143+
List<Tensor<FloatType>> outputs = new ArrayList<Tensor<FloatType>>();
144+
outputs.add(outTensor);
145145

146146
// Run the model on the input tensors. THe output tensors
147147
// will be rewritten with the result of the execution
@@ -197,8 +197,8 @@ void loadAndRunPt1(String modelFolder, String modelSource) throws LoadEngineExce
197197
// Create the input tensor with the nameand axes given by the rdf.yaml file
198198
// and add it to the list of input tensors
199199
Tensor<FloatType> inpTensor = Tensor.build("input0", "bcyx", img1);
200-
List<Tensor<T>> inputs = new ArrayList<Tensor<T>>();
201-
inputs.add((Tensor<T>) inpTensor);
200+
List<Tensor<FloatType>> inputs = new ArrayList<Tensor<FloatType>>();
201+
inputs.add(inpTensor);
202202

203203
// Create the output tensors defined in the rdf.yaml file with their corresponding
204204
// name and axes and add them to the output list of tensors.
@@ -211,8 +211,8 @@ void loadAndRunPt1(String modelFolder, String modelSource) throws LoadEngineExce
211211
new FloatType());*/
212212
final Img< FloatType > img2 = imgFactory.create( 1, 2, 512, 512 );
213213
Tensor<FloatType> outTensor = Tensor.build("output0", "bcyx", img2);
214-
List<Tensor<R>> outputs = new ArrayList<Tensor<R>>();
215-
outputs.add((Tensor<R>) outTensor);
214+
List<Tensor<FloatType>> outputs = new ArrayList<Tensor<FloatType>>();
215+
outputs.add(outTensor);
216216

217217
// Run the model on the input tensors. THe output tensors
218218
// will be rewritten with the result of the execution

0 commit comments

Comments
 (0)