Package ai.djl.pytorch.jni
Class IValueUtils
java.lang.Object
ai.djl.pytorch.jni.IValueUtils
IValueUtils is utility class to deal with IValue in PyTorch.
-
Method Summary
Modifier and TypeMethodDescriptionstatic 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.static IValue
runMethod
(PtSymbolBlock block, String methodName, IValue... inputs) Runs the method of PyTorch module.
-
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 moduleinputs
- the inputNDList
isTrain
- if running on training mode- Returns:
- the result
NDList
-
forward
Runs the forward of PyTorch module. -
runMethod
Runs the method of PyTorch module.
-