Symbol._internal._plus meaning?


#1

I have read the lstmcell code in mxnet. However, I have a question.

The following code is the part of lstmcell:

next_c = symbol._internal._plus(forget_gate * states[1], in_gate * in_transform,
name=’%sstate’%name)
next_h = symbol._internal._mul(out_gate, symbol.Activation(next_c, act_type=“tanh”),
name=’%sout’%name)

I want to know the detail of “symbol._internal._plus” and the difference between it and “mxnet.symbol.broadcast_plus”, but I don’t find it in the mxnet document.
Could any one explain it for me? Thanks so much!!


#2

@mli Could you help me explain it? Thanks.


#3

This line of code is trying to do a simple element-wise addition. The typical way of doing element-wise addition between two symbols of two NDArrays is do do something like out = x + y. However this code results in the operation name to be auto generated. If one wanted to have a dedicated name for this operator, then you’d have to invoke the operator in its function format and that’s why the code you mentioned uses symbol._internal._plus(..., name='my_unique_name').