You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, our operators use the parameter name of input/output to get the input/output variable names. For example, we are using Input("X"), Input("W"), and Input("B") in fully connected operator to get the data, weight matrix and bias. But using string is easy to get wrong, our framework should check whether that parameter name is registered in OpInfo or not. The parameter name is saved in OpProto.Var.name.
We can do this by searching the parameter name in OpProto directly. However, this implementation has several issues:
The time complexity for validating a parameter name directly by OpProto is O(n), which n is the number of inputs/outputs since it is stored in a linear list.
Gradient operators do not have OpProto.
The simpler way is to add input_params and output_params sets to OpInfo as follow:
We have recorded operators' inputs/outputs information in OpProto, so I think it's not necessary to record it again in OpInfo. If users don't assign any variables to some inputs/outputs, just leave the corresponding name vector in Op object empty.
Currently, our operators use the parameter name of input/output to get the input/output variable names. For example, we are using
Input("X")
,Input("W")
, andInput("B")
in fully connected operator to get the data, weight matrix and bias. But using string is easy to get wrong, our framework should check whether that parameter name is registered inOpInfo
or not. The parameter name is saved inOpProto.Var.name
.We can do this by searching the parameter name in
OpProto
directly. However, this implementation has several issues:OpProto
is O(n), which n is the number of inputs/outputs since it is stored in a linear list.OpProto
.The simpler way is to add
input_params
andoutput_params
sets toOpInfo
as follow:The
OpInfo
should be constructed while registering operator. It works well for both forwarding and backward operators.The text was updated successfully, but these errors were encountered: