@@ -110,7 +110,7 @@ private static org.bytedeco.pytorch.Tensor buildFromTensorByte(RandomAccessibleI
110
110
int [] sArr = new int [tensorShape .length ];
111
111
for (int i = 0 ; i < sArr .length ; i ++)
112
112
sArr [i ] = (int ) tensorShape [i ];
113
- blocks .copy ( new long [ tensorShape . length ] , flatArr , sArr );
113
+ blocks .copy ( tensor . minAsLongArray () , flatArr , sArr );
114
114
org .bytedeco .pytorch .Tensor ndarray = org .bytedeco .pytorch .Tensor .create (flatArr , ogShape );
115
115
return ndarray ;
116
116
}
@@ -135,7 +135,7 @@ private static org.bytedeco.pytorch.Tensor buildFromTensorInt(RandomAccessibleIn
135
135
int [] sArr = new int [tensorShape .length ];
136
136
for (int i = 0 ; i < sArr .length ; i ++)
137
137
sArr [i ] = (int ) tensorShape [i ];
138
- blocks .copy ( new long [ tensorShape . length ] , flatArr , sArr );
138
+ blocks .copy ( tensor . minAsLongArray () , flatArr , sArr );
139
139
org .bytedeco .pytorch .Tensor ndarray = org .bytedeco .pytorch .Tensor .create (flatArr , ogShape );
140
140
return ndarray ;
141
141
}
@@ -160,7 +160,7 @@ private static org.bytedeco.pytorch.Tensor buildFromTensorFloat(RandomAccessible
160
160
int [] sArr = new int [tensorShape .length ];
161
161
for (int i = 0 ; i < sArr .length ; i ++)
162
162
sArr [i ] = (int ) tensorShape [i ];
163
- blocks .copy ( new long [ tensorShape . length ] , flatArr , sArr );
163
+ blocks .copy ( tensor . minAsLongArray () , flatArr , sArr );
164
164
org .bytedeco .pytorch .Tensor ndarray = org .bytedeco .pytorch .Tensor .create (flatArr , ogShape );
165
165
return ndarray ;
166
166
}
@@ -185,7 +185,7 @@ private static org.bytedeco.pytorch.Tensor buildFromTensorDouble(RandomAccessibl
185
185
int [] sArr = new int [tensorShape .length ];
186
186
for (int i = 0 ; i < sArr .length ; i ++)
187
187
sArr [i ] = (int ) tensorShape [i ];
188
- blocks .copy ( new long [ tensorShape . length ] , flatArr , sArr );
188
+ blocks .copy ( tensor . minAsLongArray () , flatArr , sArr );
189
189
org .bytedeco .pytorch .Tensor ndarray = org .bytedeco .pytorch .Tensor .create (flatArr , ogShape );
190
190
return ndarray ;
191
191
}
0 commit comments