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)); }
@Override public long[] getLongShape() { long[] sh = new long[dimensions]; IntArrays.copyIntsToLongs(shape, sh); return sh; }
@Override public long elementCount() { return IntArrays.arrayProduct(shape); }
public static <T extends INDArray> SliceArray<T> of(T... slices) { return new SliceArray<T>( IntArrays.consArray(slices.length, slices[0].getShape()), slices.clone()); }