Package ai.djl.pytorch.jni
Class IValueUtils
- java.lang.Object
-
- ai.djl.pytorch.jni.IValueUtils
-
public final class IValueUtils extends java.lang.ObjectIValueUtils 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.NDListforward(PtSymbolBlock block, ai.djl.ndarray.NDList inputs, boolean isTrain)Runs the forward of PyTorch module.static IValueforward(PtSymbolBlock block, IValue[] inputs)Runs the forward of PyTorch module.static IValuerunMethod(PtSymbolBlock block, java.lang.String methodName, IValue... inputs)Runs the method of PyTorch module.
-
-
-
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 moduleinputs- the inputNDListisTrain- if running on training mode- Returns:
- the result
NDList
-
forward
public static IValue forward(PtSymbolBlock block, IValue[] inputs)
Runs the forward of PyTorch module.
-
runMethod
public static IValue runMethod(PtSymbolBlock block, java.lang.String methodName, IValue... inputs)
Runs the method of PyTorch module.
-
-