Skip to main content

a Pytorch implementation of the Reformer network (

Project description


a Pytorch implementation of the Reformer Network (

Much of this code base is loosely translated from the jax implementation found here from Google:

How to use

All of the hard work has been taken care of, all you need to do is instantiate the model!

from reformer_lm.reformer_lm import ReformerLM
import torch

test = torch.rand((4, 4, 64))
model = ReformerLM(

output = model(test)

This model is still in testing, and will therefore continue to see updates. PRs are welcomed! Feel free to take advantage of the Docker container for development. I have been working in notebooks to test code with the original paper, and then I refactor my code back into the package


Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for reformer-lm, version 1.0.1
Filename, size File type Python version Upload date Hashes
Filename, size reformer_lm-1.0.1.tar.gz (5.6 kB) File type Source Python version None Upload date Hashes View
Filename, size reformer_lm-1.0.1-py3-none-any.whl (7.6 kB) File type Wheel Python version py3 Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page