McTorch, a manifold optimization library for deep learning

McTorch is a Python package that adds manifold optimization functionality to PyTorch.


  • Leverages tensor computation and GPU acceleration from PyTorch.
  • Enables optimization on manifold constrained tensors to address nonlinear optimization problems.
  • Facilitates constrained weight tensors in deep learning layers.

McTorch builds on top of PyTorch and supports all PyTorch functions in addition to Manifold optimization. This is done to ensure researchers and developers using PyTorch can easily experiment with McTorch functions. McTorch’s manifold implementations and optimization methods are derived from the Matlab toolbox Manpot and the Python toolbox Pymanopt.

Hence, McTorch is well-suited for manifold constrained deep learning problems. McTorch is released under the open source 3-clause BSD License.

Functionality Supported

This would be an ever increasing list of features. McTorch currently supports:


  • Stiefel
  • Positive Definite

All manifolds support k multiplier as well.


  • SGD
  • Adagrad
  • Conjugate Gradient


  • Linear
  • Conv1d, Conv2d, Conv3d
  • Conv1d_transpose, Conv2d_transpose, Conv3d_transpose