OpLSTM

class OpLSTM.LSTMOpGrad(inplace)[source]
make_node(V_h, c, idx, Dd, DY, Y, H)[source]
infer_shape(node, input_shapes)[source]
c_support_code()[source]
c_code(node, name, input_names, output_names, sub)[source]
c_code_cache_version()[source]
class OpLSTM.LSTMOp(inplace)[source]
make_node(Z, V_h, c, i)[source]
Parameters:
  • Z – {input,output,forget} gate + cell state. 3d (time,batch,dim*4)
  • V_h – recurrent matrix. 2d (dim,dim*4)
  • c – initial cell state. 2d (batch,dim)
  • i – index. 2d (time,batch) -> 0 or 1
c_support_code()[source]
c_code(node, name, input_names, output_names, sub)[source]
grad(inputs, output_grads)[source]
infer_shape(node, input_shapes)[source]
c_code_cache_version()[source]
class OpLSTM.LSTMSOp(inplace)[source]
make_node(Z, V_h, c, i, att)[source]
Parameters:
  • Z – {input,output,forget} gate + cell state. 3d (time,batch,dim*4)
  • V_h – recurrent matrix. 2d (dim,dim*4)
  • c – initial cell state. 2d (batch,dim)
  • i – index. 2d (time,batch) -> 0 or 1
  • att – attention from inverted alignment layer
c_support_code()[source]
c_code(node, name, input_names, output_names, sub)[source]
grad(inputs, output_grads)[source]
infer_shape(node, input_shapes)[source]
c_code_cache_version()[source]