public class Arrayz extends Object
| Constructor and Description |
|---|
Arrayz() |
| Modifier and Type | Method and Description |
|---|---|
static void |
checkShape(INDArray array,
int dimension,
int index)
Checks that a specified index exists along a specified dimension.
|
static INDArray |
create(INDArray a) |
static INDArray |
create(Object object)
Creates an array from the given data
Handles double arrays, INDArray instances, and lists
|
static <T> INDArray |
create(T[] data)
Creates an array using the given data as slices.
|
static INDArray |
createFromVector(AVector a,
int... shape)
Creates a new array using the elements in the specified vector.
|
static INDArray |
createSparse(INDArray a)
Creates a sparse copy of the given array.
|
static <T> INDArray |
createSparse(List<T> o)
Creates a sparse array given the provided List of slice objects
|
static INDArray |
createSparse(Object o)
Creates a sparse array given the provided input object
Supports
- Numbers (wrapped as scalars)
- Existing INDArrays (copied into sparse format)
- Iterable objects (interpreted as ordered lists of major slices)
- Java Arrays (interpreted as arrays of slices Objects)
|
static <T> INDArray |
createSparse(T... slices)
Creates a sparse copy of the given data, given an array of slices to make sparse.
|
static INDArray |
createSparseArray(int... shape)
Creates a mutable sparse array of the specified shape.
|
static INDArray |
createSparseMutable(INDArray a)
Creates a fully mutable sparse clone of the given array
|
static INDArray |
createZeroArray(int... shape)
Creates an immutable zero-filled array of the given shape
|
static void |
fillNormal(INDArray a,
long seed) |
static void |
fillNormal(INDArray a,
Random random) |
static void |
fillRandom(INDArray a,
long seed) |
static void |
fillRandom(INDArray a,
Random random) |
static boolean |
isPackedLayout(double[] data,
int offset,
int[] shape,
int[] strides) |
static boolean |
isPackedStrides(int[] shape,
int[] strides)
Checks if the given set of strides represents a fully packed, row major layout for the given shape
|
static INDArray |
load(Reader reader) |
static INDArray |
newArray(int... shape)
Create a new array instance with the given shape.
|
static INDArray |
parse(String ednString)
Parse an array from a String.
|
static INDArray |
wrap(double[] data,
int[] shape)
Creates an INDArray instance wrapping the given double data, with the provided shape.
|
static INDArray |
wrapStrided(double[] data,
int offset,
int[] shape,
int[] strides) |
public static INDArray create(Object object)
object - public static INDArray newArray(int... shape)
shape - public static <T> INDArray create(T[] data)
data - public static INDArray wrap(double[] data, int[] shape)
data - shape - public static INDArray createFromVector(AVector a, int... shape)
data - rows - columns - public static INDArray parse(String ednString)
ednString - public static INDArray wrapStrided(double[] data, int offset, int[] shape, int[] strides)
public static boolean isPackedLayout(double[] data,
int offset,
int[] shape,
int[] strides)
public static boolean isPackedStrides(int[] shape,
int[] strides)
shape - strides - public static INDArray createSparse(INDArray a)
a - public static <T> INDArray createSparse(T... slices)
a - public static INDArray createSparse(Object o)
public static <T> INDArray createSparse(List<T> o)
public static INDArray createSparseMutable(INDArray a)
a - public static INDArray createZeroArray(int... shape)
shape - public static INDArray createSparseArray(int... shape)
shape - public static void fillRandom(INDArray a, long seed)
public static void fillNormal(INDArray a, long seed)
public static void checkShape(INDArray array, int dimension, int index)
array - dimension - index - IndexOutOfBoundsException - if the specified index or dimension does not exist.Copyright © 2016. All rights reserved.