Class NDUtils

java.lang.Object
ai.djl.ndarray.NDUtils

public final class NDUtils extends Object
A class containing utility methods for NDArray operations.
  • Method Details

    • getShapeFromEmptyNDArrayForReductionOp

      public static Shape getShapeFromEmptyNDArrayForReductionOp(Shape shape, int axis)
      Returns Shape of the empty NDArray after applying reduction operations.
      Parameters:
      shape - input shape
      axis - axis to apply reduction
      Returns:
      the result Shape
    • checkConcatInput

      public static void checkConcatInput(NDList list)
      Check two criteria of concat input: 1. no scalar 2. dimensions of all the array must be the same.
      Parameters:
      list - input NDList