Пример #1
0
 public static SliceArray<INDArray> create(List<INDArray> slices) {
   int slen = slices.size();
   if (slen == 0)
     throw new IllegalArgumentException("Empty list of slices provided to SliceArray");
   INDArray[] arr = new INDArray[slen];
   return new SliceArray<INDArray>(
       IntArrays.consArray(slen, slices.get(0).getShape()), slices.toArray(arr));
 }
Пример #2
0
 @Override
 public long[] getLongShape() {
   long[] sh = new long[dimensions];
   IntArrays.copyIntsToLongs(shape, sh);
   return sh;
 }
Пример #3
0
 @Override
 public long elementCount() {
   return IntArrays.arrayProduct(shape);
 }
Пример #4
0
 public static <T extends INDArray> SliceArray<T> of(T... slices) {
   return new SliceArray<T>(
       IntArrays.consArray(slices.length, slices[0].getShape()), slices.clone());
 }