Go to the documentation of this file.
24 #ifndef NNVM_OP_ATTR_TYPES_H_
25 #define NNVM_OP_ATTR_TYPES_H_
29 #include <unordered_map>
92 template <
typename AttrType>
94 const NodeAttrs& attrs, std::vector<AttrType>* in_attrs, std::vector<AttrType>* out_attrs)>;
104 std::function<std::unordered_map<std::string, std::string>(
const NodeAttrs& attrs)>;
192 const std::vector<NodeEntry>& out_grads)>;
224 std::function<bool(
const NodeAttrs& attrs, std::vector<Layout>* ilayouts,
225 const std::vector<Layout>* last_ilayouts, std::vector<Layout>* olayouts)>;
241 #endif // NNVM_OP_ATTR_TYPES_H_
std::function< void(const NodeAttrs &attrs, ObjectPtr var, const int index)> FSetInputVarAttrOnCompose
Set the attributes of input variable. Usually used for setting initialization or weight decay.
Definition: op_attr_types.h:202
std::function< uint32_t(const NodeAttrs &attrs)> FNumVisibleOutputs
Return number of visible outputs by the user.
Definition: op_attr_types.h:64
bool TIsBackward
Whether this op is an explicit backward operator, If TIsBackward is true:
Definition: op_attr_types.h:135
FInferNodeEntryAttr< TShape > FInferShape
Shape inference function. Update the shapes given the input shape information. TShape....
Definition: op_attr_types.h:116
std::function< std::vector< NodeEntry >(const ObjectPtr &nodeptr, const std::vector< NodeEntry > &out_grads)> FGradient
Get the gradient node of the op node This function generates the backward graph of the node.
Definition: op_attr_types.h:192
Data structure Tuple and TShape to store dynamic sized shapes.
std::function< std::vector< std::string >(const NodeAttrs &attrs)> FListOutputNames
Return list of output arguments names of each operator.
Definition: op_attr_types.h:75
Configuration of nnvm as well as basic data structure.
std::function< std::vector< uint32_t >(const NodeAttrs &attrs)> FMutateInputs
Check whether operator will mutate k-th input.
Definition: op_attr_types.h:85
std::function< std::vector< uint32_t >(const NodeAttrs &attrs)> FIgnoreInputs
Get list of inputs in the op whose content are actually not used by the operator These are dummy inpu...
Definition: op_attr_types.h:180
std::function< std::vector< bool >(const NodeAttrs &attrs)> FInplaceIdentity
Get if the inplace option is an identity This function enables inplace optimization even when input r...
Definition: op_attr_types.h:169
The attributes of the current operation node. Usually are additional parameters like axis,...
Definition: node.h:107
std::shared_ptr< Node > ObjectPtr
we always used ObjectPtr for a reference pointer to the node, so this alias can be changed in case.
Definition: node.h:49
std::function< std::vector< std::string >(const NodeAttrs &attrs)> FListInputNames
Return list of input arguments names of each operator.
Definition: op_attr_types.h:52
bool TIsGhost
Whether this op is a ghost node. If TIsGhost is true:
Definition: op_attr_types.h:146
std::function< std::vector< uint32_t >(const NodeAttrs &attrs)> FInputGraph
Get a list of inputs that represent graphs instead of data. Normally, input symbols are considered as...
Definition: op_attr_types.h:237
std::function< std::vector< std::pair< int, int > >(const NodeAttrs &attrs)> FInplaceOption
Get possible inplace options. This function enables optimization to reuse memory of inputs in output.
Definition: op_attr_types.h:157
Layout expression. The layout is composed of upper cases, lower cases and numbers,...
std::function< std::unordered_map< std::string, std::string >(const NodeAttrs &attrs)> FGetAttrDict
Get attribute dictionary from node.
Definition: op_attr_types.h:104
FInferNodeEntryAttr< int > FInferType
Type inference function. Update the type given the known type information.
Definition: op_attr_types.h:125
Graph node data structure.
std::function< bool(const NodeAttrs &attrs, std::vector< AttrType > *in_attrs, std::vector< AttrType > *out_attrs)> FInferNodeEntryAttr
Inference function of certain type.
Definition: op_attr_types.h:94
std::function< bool(const NodeAttrs &attrs, std::vector< Layout > *ilayouts, const std::vector< Layout > *last_ilayouts, std::vector< Layout > *olayouts)> FCorrectLayout
Infer & correct function of node layout. See Layout for layout convention.
Definition: op_attr_types.h:225