runtime functions for NDArray
More...
#include <imperative.h>
|
bool | is_training () const |
| whether operator recording is on. More...
|
|
bool | set_is_training (bool is_train) |
| turn on or turn off operator recording for autograd. More...
|
|
bool | is_recording () const |
| whether operator recording is on. More...
|
|
bool | set_is_recording (bool is_recording) |
| turn on or turn off operator recording for autograd. More...
|
|
void | RecordOp (nnvm::NodeAttrs &&attrs, const std::vector< NDArray * > &inputs, const std::vector< NDArray * > &outputs, const OpStatePtr &state=OpStatePtr(), std::vector< bool > *p_save_inputs=nullptr, std::vector< bool > *p_save_outputs=nullptr) |
| to record operator, return corresponding node. More...
|
|
OpStatePtr | Invoke (const Context &default_ctx, const nnvm::NodeAttrs &attrs, const std::vector< NDArray * > &inputs, const std::vector< NDArray * > &outputs) |
|
OpStatePtr | InvokeOp (const Context &ctx, const nnvm::NodeAttrs &attrs, const std::vector< NDArray * > &inputs, const std::vector< NDArray * > &outputs, const std::vector< OpReqType > &req, const DispatchMode dispatch_mode, OpStatePtr state=OpStatePtr()) |
|
void | MarkVariables (const std::vector< NDArray * > &variables, const std::vector< mx_uint > &grad_reqs, const std::vector< NDArray * > &gradients) |
| mark variables for computing gradients. More...
|
|
std::vector< NDArray * > | Backward (const std::vector< NDArray * > &outputs, const std::vector< NDArray * > &ograds, const std::vector< NDArray * > &variables, bool is_train, bool retain_graph, bool create_graph) |
| compute the gradient of outputs w.r.t variables. More...
|
|
runtime functions for NDArray
std::vector<NDArray*> mxnet::Imperative::Backward |
( |
const std::vector< NDArray * > & |
outputs, |
|
|
const std::vector< NDArray * > & |
ograds, |
|
|
const std::vector< NDArray * > & |
variables, |
|
|
bool |
is_train, |
|
|
bool |
retain_graph, |
|
|
bool |
create_graph |
|
) |
| |
compute the gradient of outputs w.r.t variables.
- Returns
- AutogradRuntime singleton
OpStatePtr mxnet::Imperative::Invoke |
( |
const Context & |
default_ctx, |
|
|
const nnvm::NodeAttrs & |
attrs, |
|
|
const std::vector< NDArray * > & |
inputs, |
|
|
const std::vector< NDArray * > & |
outputs |
|
) |
| |
bool mxnet::Imperative::is_recording |
( |
| ) |
const |
|
inline |
whether operator recording is on.
bool mxnet::Imperative::is_training |
( |
| ) |
const |
|
inline |
whether operator recording is on.
void mxnet::Imperative::MarkVariables |
( |
const std::vector< NDArray * > & |
variables, |
|
|
const std::vector< mx_uint > & |
grad_reqs, |
|
|
const std::vector< NDArray * > & |
gradients |
|
) |
| |
mark variables for computing gradients.
void mxnet::Imperative::RecordOp |
( |
nnvm::NodeAttrs && |
attrs, |
|
|
const std::vector< NDArray * > & |
inputs, |
|
|
const std::vector< NDArray * > & |
outputs, |
|
|
const OpStatePtr & |
state = OpStatePtr() , |
|
|
std::vector< bool > * |
p_save_inputs = nullptr , |
|
|
std::vector< bool > * |
p_save_outputs = nullptr |
|
) |
| |
to record operator, return corresponding node.
bool mxnet::Imperative::set_is_recording |
( |
bool |
is_recording | ) |
|
|
inline |
turn on or turn off operator recording for autograd.
bool mxnet::Imperative::set_is_training |
( |
bool |
is_train | ) |
|
|
inline |
turn on or turn off operator recording for autograd.
The documentation for this class was generated from the following file: