Class IValueUtils

java.lang.Object
ai.djl.pytorch.jni.IValueUtils

public final class IValueUtils extends Object
IValueUtils is utility class to deal with IValue in PyTorch.
  • Method Details

    • forward

      public static ai.djl.ndarray.NDList forward(PtSymbolBlock block, ai.djl.ndarray.NDList inputs, boolean isTrain)
      Runs the forward of PyTorch module.
      Parameters:
      block - the block that contains PyTorch module
      inputs - the input NDList
      isTrain - if running on training mode
      Returns:
      the result NDList
    • forward

      public static IValue forward(PtSymbolBlock block, IValue[] inputs)
      Runs the forward of PyTorch module.
      Parameters:
      block - the block that contains PyTorch module
      inputs - the input IValue
      Returns:
      the result IValue
    • runMethod

      public static IValue runMethod(PtSymbolBlock block, String methodName, IValue... inputs)
      Runs the method of PyTorch module.
      Parameters:
      block - the block that contains PyTorch module
      methodName - the name of method for calling
      inputs - the input IValue
      Returns:
      the result IValue