[object Object][object Object][object Object]undefined
[object Object]
  • This API is used to perform subsequent calculations after matrix multiplication in the single-step forward calculation of the long short-term memory cell (LSTM cell). It outputs the hidden state and cell state at the current time step, and also outputs the current forget gate, input gate, output gate, and candidate state for backward calculation.

  • Formula:

    Calculate the gating activation value:

    b=bih+bhhgates=inputGates+hiddenGates+biout=σ(gatesi)gout=tanh(gatesg)fout=σ(gatesf)oout=σ(gateso)\begin{aligned} b &= b_{ih} + b_{hh} \\ gates &= inputGates + hiddenGates + b \\ i_{out} &= \sigma(gates_{i}) \\ g_{out} &= \tanh(gates_{g}) \\ f_{out} &= \sigma(gates_{f}) \\ o_{out} &= \sigma(gates_{o}) \end{aligned}

    Update the cell state.

    cyout=foutcx+ioutgoutcy_{out} = f_{out} \odot cx + i_{out} \odot g_{out}

    Update the hidden state:

    tanhc=tanh(cyout)hyout=oouttanhc\begin{aligned} tanhc &= \tanh(cy_{out}) \\ hy_{out} &= o_{out} \odot tanhc \end{aligned}

    Relevant symbol description:

    • The bias bih=inputBiasOptionalb_{ih} = \text{inputBiasOptional}, bhh=hiddenBiasOptionalb_{hh} = \text{hiddenBiasOptional}. If the bias is not specified, the value is 0.
    • Split gatesgates into four components along the last dimension, that is, gatessplit[gatesi,gatesg,gatesf,gateso]gates \xrightarrow{\text{split}} [gates_i, gates_g, gates_f, gates_o].
    • Concatenate the obtained four gating activation values along the last dimension to form storageOut\text{storageOut}, that is, [iout,gout,fout,oout]concatstorageOut[i_{out}, g_{out}, f_{out}, o_{out}] \xrightarrow{\text{concat}} \text{storageOut}.
    • σ\sigma is the sigmoid activation function, and \odot is the element-wise product.
[object Object]

Each operator has calls. First, [object Object] is called to obtain the workspace size required for computation and the executor that contains the operator computation process. Then, [object Object] is called to perform computation.

[object Object]
[object Object]
[object Object]
  • Parameters

    [object Object]
  • Returns

    [object Object]: status code. For details, see .

    The first-phase API implements input parameter validation. The following error codes may be returned.

    [object Object]
[object Object]
  • Parameters

    [object Object]
  • Returns

[object Object]: status code. For details, see .

[object Object]
  • Deterministic description: The aclnnThnnFusedLstmCell is implemented in deterministic mode by default.
  • The data types of all input and output parameters must be the same.
[object Object]

The following example is for reference only. For details, see .

[object Object]