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

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

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

Nd4j.getComplexStrides介绍

[英]Get the strides based on the shape and NDArrays.order()
[中]根据形状和路线获得步幅。订单()

代码示例

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

  1. /**
  2. * Create an ndarray from the specified slices
  3. * and the given shape
  4. *
  5. * @param slices the slices of the ndarray
  6. * @param shape the final shape of the ndarray
  7. * @param ordering the ordering of the ndarray
  8. */
  9. public BaseComplexNDArray(List<IComplexNDArray> slices, int[] shape, char ordering) {
  10. this(slices, shape, Nd4j.getComplexStrides(shape, ordering), ordering);
  11. }

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

  1. /**
  2. * Create this ndarray with the given data and shape and 0 offset
  3. *
  4. * @param data the data to use
  5. * @param shape the shape of the ndarray
  6. * @param ordering
  7. */
  8. public BaseComplexNDArray(float[] data, int[] shape, char ordering) {
  9. this(data, shape, Nd4j.getComplexStrides(shape, ordering), 0, ordering);
  10. }

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

  1. /**
  2. *
  3. * @param data
  4. * @param shape
  5. * @param offset
  6. * @param ordering
  7. */
  8. public BaseComplexNDArray(IComplexNumber[] data, int[] shape, long offset, char ordering) {
  9. this(data, shape, Nd4j.getComplexStrides(shape), offset, ordering);
  10. }

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

  1. /**
  2. *
  3. * @param buffer
  4. * @param shape
  5. * @param offset
  6. * @param ordering
  7. */
  8. public BaseComplexNDArray(DataBuffer buffer, int[] shape, long offset, char ordering) {
  9. this(buffer, shape, Nd4j.getComplexStrides(shape), offset, ordering);
  10. }

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

  1. @Override
  2. protected int[] getStrides(int[] shape, char ordering) {
  3. return Nd4j.getComplexStrides(shape, ordering);
  4. }

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

  1. /**
  2. *
  3. * @param buffer
  4. * @param shape
  5. * @param offset
  6. */
  7. public BaseComplexNDArray(DataBuffer buffer, int[] shape, long offset) {
  8. this(buffer, shape, Nd4j.getComplexStrides(shape), offset, Nd4j.order());
  9. }

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

  1. /**
  2. * Creates a complex ndarray with the specified shape
  3. *
  4. * @param shape the shape of the ndarray
  5. * @return the instance
  6. */
  7. @Override
  8. public IComplexNDArray createComplex(int[] shape) {
  9. return createComplex(shape, Nd4j.getComplexStrides(shape), 0);
  10. }

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

  1. /**
  2. * Get the strides based on the shape
  3. * and NDArrays.order()
  4. *
  5. * @param shape the shape of the ndarray
  6. * @return the strides for the given shape
  7. * and order specified by NDArrays.order()
  8. */
  9. public static int[] getComplexStrides(int[] shape) {
  10. return getComplexStrides(shape, Nd4j.order());
  11. }

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

  1. public static long[] getComplexStrides(long[] shape) {
  2. return getComplexStrides(shape, Nd4j.order());
  3. }

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

  1. /**
  2. * Create an ndrray with the specified shape
  3. *
  4. * @param data the data to use with tne ndarray
  5. * @param shape the shape of the ndarray
  6. * @return the created ndarray
  7. */
  8. @Override
  9. public IComplexNDArray createComplex(double[] data, int[] shape) {
  10. //ensure shapes that wind up being scalar end up with the write shape
  11. if (shape.length == 1 && shape[0] == 0) {
  12. shape = new int[] {1, 1};
  13. }
  14. return createComplex(data, shape, Nd4j.getComplexStrides(shape), 0);
  15. }

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

  1. /**
  2. * Create an ndrray with the specified shape
  3. *
  4. * @param data the data to use with tne ndarray
  5. * @param shape the shape of the ndarray
  6. * @return the created ndarray
  7. */
  8. @Override
  9. public IComplexNDArray createComplex(float[] data, int[] shape) {
  10. //ensure shapes that wind up being scalar end up with the write shape
  11. if (shape.length == 1 && shape[0] == 0) {
  12. shape = new int[] {1, 1};
  13. }
  14. return createComplex(data, shape, Nd4j.getComplexStrides(shape), 0);
  15. }

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

  1. /**
  2. * Creates an ndarray with the specified data
  3. *
  4. * @param data the number of columns in the row vector
  5. * @return ndarray
  6. */
  7. public static IComplexNDArray createComplex(double[] data, char order) {
  8. IComplexNDArray ret = INSTANCE.createComplex(data, Nd4j.getComplexStrides(new int[] {1, data.length}, order), 0,
  9. order);
  10. logCreationIfNecessary(ret);
  11. return ret;
  12. }

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

  1. /**
  2. *
  3. * @param shape
  4. * @param offset
  5. * @param ordering
  6. */
  7. public BaseComplexNDArray(int[] shape, long offset, char ordering) {
  8. this(Nd4j.createBuffer(ArrayUtil.prodLong(shape) * 2), shape, Nd4j.getComplexStrides(shape, ordering), offset,
  9. ordering);
  10. }

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

  1. /**
  2. *
  3. * @param shape
  4. */
  5. public BaseComplexNDArray(int[] shape) {
  6. this(Nd4j.createBuffer(ArrayUtil.prodLong(shape) * 2), shape, Nd4j.getComplexStrides(shape));
  7. }

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

  1. public BaseComplexNDArray(int[] shape, char ordering) {
  2. this(Nd4j.createBuffer(ArrayUtil.prodLong(shape) * 2), shape, Nd4j.getComplexStrides(shape, ordering), 0,
  3. ordering);
  4. }

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

  1. public BaseComplexNDArray(long[] shape, char ordering) {
  2. this(Nd4j.createBuffer(ArrayUtil.prodLong(shape) * 2), shape, Nd4j.getComplexStrides(shape, ordering), 0,
  3. ordering);
  4. }

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

  1. /**
  2. * Creates an ndarray
  3. *
  4. * @param columns the number of columns in the row vector
  5. * @return ndarray
  6. */
  7. public static IComplexNDArray createComplex(int columns, char order) {
  8. int[] shape = new int[] {1, columns};
  9. IComplexNDArray ret =
  10. INSTANCE.createComplex(new int[] {1, columns}, Nd4j.getComplexStrides(shape, order), 0, order);
  11. logCreationIfNecessary(ret);
  12. return ret;
  13. }

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

  1. @Override
  2. protected IComplexNDArray create(int[] shape) {
  3. return Nd4j.createComplex(shape, Nd4j.getComplexStrides(shape, ordering()), 0);
  4. }

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

  1. public BaseComplexNDArray(long[] shape) {
  2. this(Nd4j.createBuffer(ArrayUtil.prodLong(shape) * 2), shape, Nd4j.getComplexStrides(shape));
  3. }

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

  1. /**
  2. * Creates a complex ndarray with the specified shape
  3. *
  4. * @param rows the rows of the ndarray
  5. * @param columns the columns of the ndarray
  6. * @return the instance
  7. */
  8. public static IComplexNDArray createComplex(int rows, int columns, char ordering) {
  9. int[] shape = getEnsuredShape(rows, columns);
  10. checkShapeValues(shape);
  11. IComplexNDArray ret = INSTANCE.createComplex(shape, Nd4j.getComplexStrides(shape, ordering), 0, ordering);
  12. logCreationIfNecessary(ret);
  13. return ret;
  14. }

相关文章