org.nd4j.linalg.factory.Nd4j.order()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(5.2k)|赞(0)|评价(0)|浏览(189)

本文整理了Java中org.nd4j.linalg.factory.Nd4j.order()方法的一些代码示例,展示了Nd4j.order()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Nd4j.order()方法的具体详情如下:
包路径:org.nd4j.linalg.factory.Nd4j
类名称:Nd4j
方法名:order

Nd4j.order介绍

[英]Returns the ordering of the ndarrays
[中]返回数据数组的顺序

代码示例

代码示例来源:origin: deeplearning4j/nd4j

/**
 * Create an ndarray
 * with the given shape
 * @param shape
 */
public BaseNDArray(int[] shape) {
  this(shape, 0, Nd4j.order());
}

代码示例来源:origin: deeplearning4j/nd4j

/**
 * Creates a new <i>n</i> times <i>m</i> <tt>DoubleMatrix</tt>.
 *
 * @param newRows    the number of rows (<i>n</i>) of the new matrix.
 * @param newColumns the number of columns (<i>m</i>) of the new matrix.
 */
public BaseNDArray(int newRows, int newColumns) {
  this(newRows, newColumns, Nd4j.order());
}

代码示例来源:origin: deeplearning4j/nd4j

/**
 * Create an ndarray from the specified slices.
 * This will go through and merge all of the
 * data from each slice in to one ndarray
 * which will then take the specified shape
 *
 * @param slices the slices to merge
 * @param shape  the shape of the ndarray
 */
public BaseNDArray(List<INDArray> slices, int[] shape) {
  this(slices, shape, Nd4j.order());
}

代码示例来源:origin: deeplearning4j/nd4j

/**
 * Create with the specified ndarray as the real component
 * and the given stride
 *
 * @param m      the ndarray to use as the stride
 * @param stride the stride of the ndarray
 */
public BaseComplexNDArray(INDArray m, int[] stride) {
  this(m, stride, Nd4j.order());
}

代码示例来源:origin: deeplearning4j/nd4j

/**
 * Create an ndarray from the specified slices
 * and the given shape
 *
 * @param slices the slices of the ndarray
 * @param shape  the final shape of the ndarray
 * @param stride the stride of the ndarray
 */
public BaseComplexNDArray(List<IComplexNDArray> slices, int[] shape, int[] stride) {
  this(slices, shape, stride, Nd4j.order());
}

代码示例来源:origin: deeplearning4j/nd4j

/**
 *
 * @param buffer
 * @param shape
 * @param strides
 */
public BaseNDArray(DataBuffer buffer, int[] shape, int[] strides) {
  this(buffer, shape, strides, 0, Nd4j.order());
}

代码示例来源:origin: deeplearning4j/nd4j

/**
 * Initialize the ndarray
 * with the given data
 * @param data
 */
public BaseNDArray(float[][] data) {
  this(data, Nd4j.order());
}

代码示例来源:origin: deeplearning4j/nd4j

/**
 *
 * @param data
 * @param shape
 */
public BaseNDArray(DataBuffer data, int[] shape) {
  this(data, shape, Nd4j.getStrides(shape, Nd4j.order()), 0, Nd4j.order());
}

代码示例来源:origin: deeplearning4j/nd4j

/**
 * Creates an ndarray with the specified shape
 *
 * @param shape the shape of the ndarray
 * @return the instance
 */
public static INDArray create(int... shape) {
  return create(shape, order());
}

代码示例来源:origin: deeplearning4j/nd4j

/**
 *
 * @param data
 * @param shape
 * @param offset
 * @return
 */
public static IComplexNDArray createComplex(double[] data, int[] shape, long offset) {
  return createComplex(data, shape, offset, Nd4j.order());
}

代码示例来源:origin: deeplearning4j/nd4j

/**
 * Creates an ndarray with the specified shape
 *
 * @param shape  the shape of the ndarray
 * @param stride the stride for the ndarray
 * @return the instance
 */
public static INDArray create(int[] shape, int[] stride) {
  return create(shape, stride, order());
}

代码示例来源:origin: deeplearning4j/nd4j

/**
 * Creates a complex ndarray with the specified shape
 *
 * @param shape the shape of the ndarray
 * @return the instance
 */
public static IComplexNDArray createComplex(int... shape) {
  return createComplex(shape, order());
}

代码示例来源:origin: deeplearning4j/nd4j

/**
 * Cretes uninitialized INDArray detached from any (if any) workspace
 *
 * @param shape
 * @return
 */
public static INDArray createUninitializedDetached(int[] shape) {
  return createUninitializedDetached(shape, Nd4j.order());
}

代码示例来源:origin: deeplearning4j/nd4j

/**
 * Get the strides based on the shape
 * and NDArrays.order()
 *
 * @param shape the shape of the ndarray
 * @return the strides for the given shape
 * and order specified by NDArrays.order()
 */
public static int[] getComplexStrides(int[] shape) {
  return getComplexStrides(shape, Nd4j.order());
}

代码示例来源:origin: deeplearning4j/nd4j

/**
 * This method creates shapeInformation buffer, based on shape being passed in
 *
 * @param shape
 * @return
 */
@Override
public Pair<DataBuffer, long[]> createShapeInformation(long[] shape) {
  char order = Nd4j.order();
  return createShapeInformation(shape, order);
}

代码示例来源:origin: deeplearning4j/nd4j

public static INDArray createUninitialized(long length) {
  if (length < 1)
    throw new IllegalStateException("INDArray length should be positive value");
  long[] shape = new long[] {1, length};
  INDArray ret = INSTANCE.createUninitialized(shape, order());
  logCreationIfNecessary(ret);
  return ret;
}

代码示例来源:origin: deeplearning4j/nd4j

@Override
public INDArray valueArrayOf(long[] shape, double value) {
  INDArray ret = Nd4j.createUninitialized(shape, Nd4j.order());
  ret.assign(value);
  return ret;
}

代码示例来源:origin: deeplearning4j/nd4j

public static INDArray rand(long[] shape) {
  INDArray ret = createUninitialized(shape, order()); //INSTANCE.rand(shape, Nd4j.getRandom());
  logCreationIfNecessary(ret);
  return rand(ret);
}

代码示例来源:origin: deeplearning4j/nd4j

/**
 * Create a random ndarray with the given shape using the given RandomGenerator
 *
 * @param shape the shape of the ndarray
 * @param rng     the random generator to use
 * @return the random ndarray with the specified shape
 */
public static INDArray rand(int[] shape, org.nd4j.linalg.api.rng.Random rng) {
  INDArray ret = createUninitialized(shape, Nd4j.order()); //INSTANCE.rand(shape, rng);
  logCreationIfNecessary(ret);
  return rand(ret, rng);
}

代码示例来源:origin: deeplearning4j/nd4j

/**
 * Random normal using the specified seed
 *
 * @param shape the shape of the ndarray
 * @return
 */
public static INDArray randn(int[] shape, long seed) {
  INDArray ret = Nd4j.createUninitialized(shape, order());
  logCreationIfNecessary(ret);
  return randn(ret, seed);
}

相关文章