public class MxGradientCollector
extends java.lang.Object
implements ai.djl.training.GradientCollector
MxGradientCollector is the MXNet implementation of GradientCollector.| Modifier and Type | Method and Description |
|---|---|
void |
backward(ai.djl.ndarray.NDArray array) |
void |
close() |
static Symbol |
getSymbol(ai.djl.ndarray.NDManager manager,
ai.djl.ndarray.NDArray array)
Returns the
Symbol of a network formed by the recorded operations on the given NDArray. |
static boolean |
isRecording()
Gets whether Autograd is recording computations.
|
static boolean |
isTraining()
Gets whether Autograd is in training/predicting mode.
|
static boolean |
setRecording(boolean isRecording)
Sets the status to recording/not recording.
|
static boolean |
setTraining(boolean isTraining)
Sets the status to training/predicting.
|
public static boolean isRecording()
public static boolean isTraining()
public static boolean setRecording(boolean isRecording)
isRecording - the recording state to be setpublic static boolean setTraining(boolean isTraining)
isTraining - true if for trainingpublic static Symbol getSymbol(ai.djl.ndarray.NDManager manager, ai.djl.ndarray.NDArray array)
Symbol of a network formed by the recorded operations on the given NDArray.public void close()
close in interface ai.djl.training.GradientCollectorclose in interface java.lang.AutoCloseablepublic void backward(ai.djl.ndarray.NDArray array)
backward in interface ai.djl.training.GradientCollector