public class NDArrayCreationUtil extends Object
Modifier and Type | Method and Description |
---|---|
static int[] |
broadcastToShape(int[] inputShapeWithOnes,
long seed)
Generate a random shape to
broadcast to
given a randomly generated
shape with 1s in it as inputs
|
static long[] |
broadcastToShape(long[] inputShapeWithOnes,
long seed) |
static List<Pair<INDArray,String>> |
get3dPermutedWithShape(int seed,
int[] shape,
DataType dataType) |
static List<Pair<INDArray,String>> |
get3dPermutedWithShape(long seed,
long[] shape,
DataType dataType) |
static List<Pair<INDArray,String>> |
get3dReshapedWithShape(int seed,
int[] shape,
DataType dataType) |
static List<Pair<INDArray,String>> |
get3dReshapedWithShape(long seed,
long[] shape,
DataType dataType) |
static List<Pair<INDArray,String>> |
get3dSubArraysWithShape(int seed,
int[] shape,
DataType dataType) |
static List<Pair<INDArray,String>> |
get3dSubArraysWithShape(long seed,
long[] shape,
DataType dataType) |
static List<Pair<INDArray,String>> |
get3dTensorAlongDimensionWithShape(int seed,
int[] shape,
DataType dataType) |
static List<Pair<INDArray,String>> |
get3dTensorAlongDimensionWithShape(long seed,
long[] shape,
DataType dataType) |
static List<Pair<INDArray,String>> |
get4dPermutedWithShape(int seed,
int[] shape,
DataType dataType) |
static List<Pair<INDArray,String>> |
get4dReshapedWithShape(int seed,
int[] shape,
DataType dataType) |
static List<Pair<INDArray,String>> |
get4dSubArraysWithShape(int seed,
int[] shape,
DataType dataType) |
static List<Pair<INDArray,String>> |
get4dTensorAlongDimensionWithShape(int seed,
int[] shape,
DataType dataType) |
static List<Pair<INDArray,String>> |
get5dPermutedWithShape(int seed,
int[] shape,
DataType dataType) |
static List<Pair<INDArray,String>> |
get5dReshapedWithShape(int seed,
int[] shape,
DataType dataType) |
static List<Pair<INDArray,String>> |
get5dSubArraysWithShape(int seed,
int[] shape,
DataType dataType) |
static List<Pair<INDArray,String>> |
get5dTensorAlongDimensionWithShape(int seed,
int[] shape,
DataType dataType) |
static List<Pair<INDArray,String>> |
get6dPermutedWithShape(int seed,
int[] shape,
DataType dataType) |
static List<Pair<INDArray,String>> |
get6dReshapedWithShape(int seed,
int[] shape,
DataType dataType) |
static List<Pair<INDArray,String>> |
get6dSubArraysWithShape(int seed,
int[] shape,
DataType dataType) |
static List<Pair<INDArray,String>> |
getAll3dTestArraysWithShape(int seed,
int[] shape,
DataType dataType) |
static List<Pair<INDArray,String>> |
getAll3dTestArraysWithShape(long seed,
long[] shape,
DataType dataType) |
static List<Pair<INDArray,String>> |
getAll4dTestArraysWithShape(int seed,
int[] shape,
DataType dataType) |
static List<Pair<INDArray,String>> |
getAll4dTestArraysWithShape(int seed,
long[] shape,
DataType dataType) |
static List<Pair<INDArray,String>> |
getAll5dTestArraysWithShape(int seed,
int[] shape,
DataType dataType) |
static List<Pair<INDArray,String>> |
getAll6dTestArraysWithShape(int seed,
int[] shape,
DataType dataType) |
static List<Pair<INDArray,String>> |
getAllTestMatricesWithShape(char ordering,
int rows,
int cols,
int seed,
DataType dataType)
Get an array of INDArrays (2d) all with the specified shape.
|
static List<Pair<INDArray,String>> |
getAllTestMatricesWithShape(long rows,
long cols,
long seed,
DataType dataType)
Get an array of INDArrays (2d) all with the specified shape.
|
static Pair<INDArray,String> |
getPermutedWithShape(char ordering,
long rows,
long cols,
long seed,
DataType dataType) |
static Pair<INDArray,String> |
getPermutedWithShape(long rows,
long cols,
long seed,
DataType dataType) |
static int[][] |
getRandomBroadCastShape(long seed,
int rank,
int numShapes)
Create an ndarray
of
|
static Pair<INDArray,String> |
getReshapedWithShape(char ordering,
long rows,
long cols,
long seed,
DataType dataType) |
static Pair<INDArray,String> |
getReshapedWithShape(long rows,
long cols,
long seed,
DataType dataType) |
static List<Pair<INDArray,String>> |
getSubMatricesWithShape(char ordering,
long rows,
long cols,
long seed,
DataType dataType) |
static List<Pair<INDArray,String>> |
getSubMatricesWithShape(long rows,
long cols,
long seed,
DataType dataType) |
static List<Pair<INDArray,String>> |
getTensorAlongDimensionMatricesWithShape(char ordering,
long rows,
long cols,
long seed,
DataType dataType) |
static List<Pair<INDArray,String>> |
getTensorAlongDimensionMatricesWithShape(long rows,
long cols,
long seed,
DataType dataType) |
static List<Pair<INDArray,String>> |
getTestMatricesWithVaryingShapes(int rank,
char order,
DataType dataType)
Test utility to sweep shapes given a rank
Given a rank will generate random test matrices that will cover all cases of a shape with a '1' anywhere in the shape
as well a shape with random ints that are not 0 or 1
eg.
|
static Pair<INDArray,String> |
getTransposedMatrixWithShape(char ordering,
int rows,
int cols,
int seed,
DataType dataType) |
static Pair<INDArray,String> |
getTransposedMatrixWithShape(long rows,
long cols,
long seed,
DataType dataType) |
public static List<Pair<INDArray,String>> getAllTestMatricesWithShape(char ordering, int rows, int cols, int seed, DataType dataType)
public static List<Pair<INDArray,String>> getAllTestMatricesWithShape(long rows, long cols, long seed, DataType dataType)
public static List<Pair<INDArray,String>> getTestMatricesWithVaryingShapes(int rank, char order, DataType dataType)
rank
- any rank including true scalars i.e rank >= 0order
- what order array to return i.e 'c' or 'f' order arrayspublic static Pair<INDArray,String> getTransposedMatrixWithShape(char ordering, int rows, int cols, int seed, DataType dataType)
public static Pair<INDArray,String> getTransposedMatrixWithShape(long rows, long cols, long seed, DataType dataType)
public static List<Pair<INDArray,String>> getSubMatricesWithShape(long rows, long cols, long seed, DataType dataType)
public static List<Pair<INDArray,String>> getSubMatricesWithShape(char ordering, long rows, long cols, long seed, DataType dataType)
public static List<Pair<INDArray,String>> getTensorAlongDimensionMatricesWithShape(char ordering, long rows, long cols, long seed, DataType dataType)
public static List<Pair<INDArray,String>> getTensorAlongDimensionMatricesWithShape(long rows, long cols, long seed, DataType dataType)
public static Pair<INDArray,String> getPermutedWithShape(char ordering, long rows, long cols, long seed, DataType dataType)
public static Pair<INDArray,String> getPermutedWithShape(long rows, long cols, long seed, DataType dataType)
public static Pair<INDArray,String> getReshapedWithShape(char ordering, long rows, long cols, long seed, DataType dataType)
public static Pair<INDArray,String> getReshapedWithShape(long rows, long cols, long seed, DataType dataType)
public static List<Pair<INDArray,String>> getAll3dTestArraysWithShape(int seed, int[] shape, DataType dataType)
public static List<Pair<INDArray,String>> getAll3dTestArraysWithShape(long seed, long[] shape, DataType dataType)
public static List<Pair<INDArray,String>> get3dSubArraysWithShape(int seed, int[] shape, DataType dataType)
public static List<Pair<INDArray,String>> get3dSubArraysWithShape(long seed, long[] shape, DataType dataType)
public static List<Pair<INDArray,String>> get3dTensorAlongDimensionWithShape(int seed, int[] shape, DataType dataType)
public static List<Pair<INDArray,String>> get3dTensorAlongDimensionWithShape(long seed, long[] shape, DataType dataType)
public static List<Pair<INDArray,String>> get3dPermutedWithShape(int seed, int[] shape, DataType dataType)
public static List<Pair<INDArray,String>> get3dPermutedWithShape(long seed, long[] shape, DataType dataType)
public static List<Pair<INDArray,String>> get3dReshapedWithShape(int seed, int[] shape, DataType dataType)
public static List<Pair<INDArray,String>> get3dReshapedWithShape(long seed, long[] shape, DataType dataType)
public static List<Pair<INDArray,String>> getAll4dTestArraysWithShape(int seed, long[] shape, DataType dataType)
public static List<Pair<INDArray,String>> getAll4dTestArraysWithShape(int seed, int[] shape, DataType dataType)
public static List<Pair<INDArray,String>> get4dSubArraysWithShape(int seed, int[] shape, DataType dataType)
public static List<Pair<INDArray,String>> get4dTensorAlongDimensionWithShape(int seed, int[] shape, DataType dataType)
public static List<Pair<INDArray,String>> get4dPermutedWithShape(int seed, int[] shape, DataType dataType)
public static List<Pair<INDArray,String>> get4dReshapedWithShape(int seed, int[] shape, DataType dataType)
public static List<Pair<INDArray,String>> getAll5dTestArraysWithShape(int seed, int[] shape, DataType dataType)
public static List<Pair<INDArray,String>> get5dSubArraysWithShape(int seed, int[] shape, DataType dataType)
public static List<Pair<INDArray,String>> get5dTensorAlongDimensionWithShape(int seed, int[] shape, DataType dataType)
public static List<Pair<INDArray,String>> get5dPermutedWithShape(int seed, int[] shape, DataType dataType)
public static List<Pair<INDArray,String>> get5dReshapedWithShape(int seed, int[] shape, DataType dataType)
public static List<Pair<INDArray,String>> getAll6dTestArraysWithShape(int seed, int[] shape, DataType dataType)
public static List<Pair<INDArray,String>> get6dSubArraysWithShape(int seed, int[] shape, DataType dataType)
public static List<Pair<INDArray,String>> get6dPermutedWithShape(int seed, int[] shape, DataType dataType)
public static List<Pair<INDArray,String>> get6dReshapedWithShape(int seed, int[] shape, DataType dataType)
public static int[][] getRandomBroadCastShape(long seed, int rank, int numShapes)
seed
- rank
- numShapes
- public static int[] broadcastToShape(int[] inputShapeWithOnes, long seed)
inputShapeWithOnes
- seed
- public static long[] broadcastToShape(long[] inputShapeWithOnes, long seed)
Copyright © 2021. All rights reserved.