torchscale is a PyTorch library for building large-scale Transformer models, providing components like Multi-head Attention (MHA), Long Short-Term Memory (LSTM), and other scalable architectures. As of version 0.3.0, it supports Python >=3.8 and is maintained by Microsoft. Releases are infrequent.
pip install torchscaleNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Initialize MHA and IncrementalDecoder with random input.
Replace `LongShortTerm` with `IncrementalDecoder` or `TemporalDecoder` depending on use case.
Remove `kdim` and `vdim` from MHA constructor and ensure all dimensions match `embed_dim`.
Ensure input tensors have shape (batch, sequence, features) or use .transpose() if needed.