Skip to content

Commit

Permalink
correct tensor transformation
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosuc3m committed Oct 17, 2023
1 parent d9b3b5a commit bc17ca2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main/java/io/bioimage/modelrunner/tensor/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ RandomAccessibleInterval<T> transpose(RandomAccessibleInterval<T> rai){
int[] transposeAxesOrderChange = new int[tensorShape.length];
for (int i = 0; i < tensorShape.length; i ++) transposeAxesOrderChange[i] = tensorShape.length - 1 - i;
t.setComponentMapping(transposeAxesOrderChange);
long[] minMax = new long[tensorShape.length];
for (int i = 0; i < tensorShape.length; i ++) minMax[i * 2 + 1] = tensorShape[i];
long[] minMax = new long[tensorShape.length * 2];
for (int i = 0; i < tensorShape.length; i ++) minMax[i + tensorShape.length] = tensorShape[i] - 1;
return Views.interval(new MixedTransformView<T>( rai, t ),
Intervals.createMinMax(tensorShape));
Intervals.createMinMax(minMax));
}
}

0 comments on commit bc17ca2

Please sign in to comment.