Skip to main content
https://badge.fury.io/py/pytorch-lantern.svg https://img.shields.io/pypi/pyversions/pytorch-lantern.svg https://readthedocs.org/projects/pytorch-lantern/badge/?version=latest https://img.shields.io/pypi/l/pytorch-lantern.svg https://img.shields.io/badge/code%20style-black-000000.svg

Lantern contains our process of bringing a project to fruition as efficiently as possible. This is subject to change as we iterate and improve. This package implements tools and missing features to help bridge the gap between frameworks and libraries that we utilize.

The main packages and tools that we build around are:

Usage

Example of tensor type hinting.

from pydantic import BaseModel
from typing import Annotated
import torch
from lantern import Tensor

class Example(BaseModel):
    image: Annotated[torch.Tensor, Tensor.dims("NCHW").float()]
    label: Annotated[torch.Tensor, Tensor.dims("N").long()]

example = Example(
    image=torch.rand(32, 3, 224, 224),  # 32 images, 3 channels, 224x224 pixels
    label=torch.randint(0, 10, (32,))   # 32 labels
)

See the documentation for more information and usage examples.

Create new project with template

Install cookiecutter and poetry:

pip install cookiecutter
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python

Setup project:

cookiecutter https://github.com/nextml-code/pytorch-lantern-template.git
cd <new-project>
poetry install

You can now train the placeholder model and inspect the results:

guild run prepare
guild run train
guild tensorboard

Use lantern without templates

Install lantern from pypi using pip or poetry:

poetry add pytorch-lantern[training]
pip install pytorch-lantern[training]

Metadata

Release files for pytorch-lantern 0.12.15

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pytorch-lantern 0.12.15
File Size Uploaded
pytorch_lantern-0.12.15.tar.gz 9.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pytorch-lantern 0.12.15
File Interpreter ABI Platform
pytorch_lantern-0.12.15-py3-none-any.whl Python 3 none any Details

Total release size: 24.3 kB

Release files / pytorch_lantern-0.12.15.tar.gz

Download URL pytorch_lantern-0.12.15.tar.gz
Size 9.5 kB
Tags Source
SHA-256 checksum
How to use checksums
fd1db5d79a958664d5d5d46f8da6f4193e98b389db84a33aa60620d519a013b3
BLAKE2b-256 checksum
How to use checksums
dfc71b56dcfc3ac36fa357decff3d0a082d101408a30e3ee0468be5f3613ae84
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.27 {"installer":{"name":"uv","version":"0.11.27","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / pytorch_lantern-0.12.15-py3-none-any.whl

Download URL pytorch_lantern-0.12.15-py3-none-any.whl
Size 14.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dbcb05d8ca2e84004ebb3644ca1d6deac53dd3748783acf8af327ed33386cfac
BLAKE2b-256 checksum
How to use checksums
833c30c305332a164af1d54f5c513bca6f6c1a98011e144cad59ee3f0391a1b7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.27 {"installer":{"name":"uv","version":"0.11.27","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

This release

0.12.15 This release

2 release files

0.12.9

2 release files

0.12.8

2 release files

0.12.7

2 release files

0.12.4

2 release files

0.12.3

2 release files

0.12.1

2 release files

0.12.0

2 release files

0.10.0

2 release files

0.9.4

2 release files

0.9.3

2 release files

0.9.2

2 release files

0.9.1

2 release files

0.9.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page