OpLSTMRec

class OpLSTMRec.LSTMRecOpGrad(fun_name, inplace, recurrent_transform)[source]
make_node(Y, H, c, y0, i, Dd, DY, *args)[source]
c_support_code()[source]
c_code(node, name, input_names, output_names, sub)[source]
class OpLSTMRec.LSTMRecOp(fun_name, inplace, recurrent_transform)[source]
make_node(Z, c, y0, i, *args)[source]
Parameters:
  • Z – {input,output,forget} gate + cell state. 3d (time,batch,dim*4)
  • c – initial cell state. 2d (batch,dim)
  • y0 – output of t = -1 (for recursion at t = 0). 2d (batch,dim)
  • i – index. 2d (time,batch) -> 0 or 1
  • args – custom_inputs + initial_state_vars: other inputs for the custom function
c_support_code()[source]
c_code(node, name, input_names, output_names, sub)[source]
grad(inputs, output_grads)[source]
OpLSTMRec.register_func(recurrent_transform)[source]