Rate this Page

LSTMCell#

classtorch.ao.nn.quantized.dynamic.LSTMCell(*args,**kwargs)[source]#

A long short-term memory (LSTM) cell.

A dynamic quantized LSTMCell module with floating point tensor as inputs and outputs.Weights are quantized to 8 bits. We adopt the same interface astorch.nn.LSTMCell,please seehttps://pytorch.org/docs/stable/nn.html#torch.nn.LSTMCell for documentation.

Examples:

>>>rnn=nn.LSTMCell(10,20)>>>input=torch.randn(6,3,10)>>>hx=torch.randn(3,20)>>>cx=torch.randn(3,20)>>>output=[]>>>foriinrange(6):...hx,cx=rnn(input[i],(hx,cx))...output.append(hx)