A PyTorch implementation of the Discrete Cosine Transform (DCT) and its inverse. Currently at version 0.1.6, the library provides functions for 1D, 2D, and 3D DCT and IDCT, supporting both orthogonal and non-orthogonal scaling. The package is mature but has a slow release cadence.
pip install torch-dctNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Compute DCT and IDCT on a random tensor with orthogonal normalization.
Always specify norm='ortho' unless you have a specific reason otherwise.
Ensure input tensor dimensions match the DCT variant you intend to use (e.g., flatten before calling dct for 1D).
Use 'import torch_dct' or 'from torch_dct import dct'.