Table of Contents
Shortcuts

# RNNBase

class torch.nn.RNNBase(mode, input_size, hidden_size, num_layers=1, bias=True, batch_first=False, dropout=0.0, bidirectional=False, proj_size=0, device=None, dtype=None)

  Base class for RNN modules (RNN, LSTM, GRU).

  Implements aspects of RNNs shared by the RNN, LSTM, and GRU classes, such as module initialization and utility methods for parameter storage management.

  Note

  The forward method is not implemented by the RNNBase class.

  Note

  LSTM and GRU classes override some methods implemented by RNNBase.

  flatten_parameters()

    Resets parameter data pointer so that they can use faster code paths.

    Right now, this works only if the module is on the GPU and cuDNN is enabled. Otherwise, it’s a no-op.

## Docs

Access comprehensive developer documentation for PyTorch

View Docs

## Tutorials

Get in-depth tutorials for beginners and advanced developers

View Tutorials

## Resources

Find development resources and get your questions answered

View Resources

To analyze traffic and optimize your experience, we serve cookies on this site. By clicking or navigating, you agree to allow our usage of cookies. As the current maintainers of this site, Facebook’s Cookies Policy applies. Learn more, including about available controls: Cookies Policy.