OpenViSTAI · Agents · Blockchain · Crypto
Menu
AI Developer Tools & SDKs

Torchopt

TorchOpt is a Python library built on PyTorch for differentiable optimization, functional optimizers, and optimization workflows such as bilevel optimization and meta-learning.

Independent OpenViST project profile, based on linked sources.

Torchopt — Differentiable optimization experiments in PyTorch
OpenViST project illustration. See the linked sources for product details.
Understand the project

Practical overview

When it fits

Use TorchOpt when a PyTorch project needs optimization steps that can participate in differentiation, or when developing functional, bilevel, or meta-learning optimization methods.

Who it is for

  • PyTorch developers implementing differentiable optimization methods.
  • Researchers and practitioners prototyping bilevel optimization or meta-learning algorithms.

Documented uses

  • Build functional optimizers for PyTorch models.
  • Differentiate through optimization using explicit, implicit, or zero-order methods.
  • Prototype bilevel optimization and meta-learning workflows.
Before you choose

Requirements & limits

The project is open source under the Apache-2.0 license. Installation instructions use PyPI or a source checkout.

  • PyTorch is a prerequisite and should be installed before TorchOpt.
  • CPU and CUDA use require attention to the matching PyTorch build; a CUDA-specific package index may be needed.
  • Graphviz is optional and applies to computation-graph visualization.

Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.

Source-based practical guide

Install TorchOpt from PyPI

Install TorchOpt in a Python environment with PyTorch already installed.

Before you start

  • A Python environment
  • PyTorch installed in that environment, following the PyTorch installation instructions

Steps

  1. Install PyTorch in the Python environment first.

  2. Run the command below.

    Documented command
    pip3 install torchopt
  3. If you need a specific PyTorch CPU or CUDA build, use the appropriate PyTorch extra index URL; the README shows the command below as an example.

    Documented command
    pip3 install torchopt --extra-index-url https://download.pytorch.org/whl/cu121

Expected outcome

TorchOpt is installed from PyPI in the Python environment.

Guide limitations

  • The README warns that pip may install or upgrade PyTorch if the minimum version is not satisfied.
  • Choose a PyTorch build appropriate for your CPU or CUDA setup; the CUDA 12.1 index URL is only an example.
  • Graphviz is optional and is listed for visualizing computation graphs.
Source-based practical guide

Install TorchOpt from a source checkout

Clone the TorchOpt repository and install the package from its source tree.

Before you start

  • Git
  • PyTorch installed in the Python environment

Steps

  1. Clone the repository with the command below.

    Documented command
    git clone https://github.com/metaopt/torchopt.git
  2. Change into the checkout with cd torchopt.

  3. Run the command below.

    Documented command
    pip3 install .

Expected outcome

TorchOpt is installed from the checked-out source tree.

Guide limitations

  • The README does not describe running or deploying TorchOpt after installation.
  • For source builds, the README separately describes a conda environment recipe for build tools such as cmake, g++, and nvcc; the listed steps do not create that environment.
Evidence and transparency

Sources & review

Source record details
Source availability
Active
Sources checked
8 November 2026
Original website title
metaopt/torchopt · Official homepage title · retained in its source language