Class IValueUtils


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

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static ai.djl.ndarray.NDList forward​(PtSymbolBlock block, ai.djl.ndarray.NDList inputs, boolean isTrain)
      Runs the forward of PyTorch module.
      static IValue forward​(PtSymbolBlock block, IValue... inputs)
      Runs the forward of PyTorch module.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • 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