{"categories":[{"label":"Artificial Intelligence","url":"https://skillfed.io/packages/category/scientific-engineering-artificial-intelligence/10"}],"enrichment":{"capability":"Extends PyTorch's unfold and fold operations to 3D, 4D, and 5D tensors, implementing im2col and col2im for higher-dimensional inputs that PyTorch's native functions do not support.","skillfed_tags":["pytorch-extension","convolution-optimization","tensor-operations"],"use_cases":["Implementing second-order optimization methods like KFAC that approximate the Fisher matrix using Kronecker factors on volumetric (3D) convolutions.","Expressing 3D or 5D convolutions as explicit matrix multiplications for custom automatic differentiation or layer implementations.","Unfolding inputs for transpose convolutions in higher dimensions where PyTorch provides no native support.","Research on convolution-as-linear-layer perspectives in deep learning frameworks like BackPACK."],"what_it_does":"unfoldNd generalizes PyTorch's im2col (unfold) and col2im (fold) operations to tensors with more than 4 dimensions. PyTorch's native torch.nn.functional.unfold and torch.nn.Unfold only work on 4D batched image tensors; this package extends that functionality to 3D, 4D, and 5D inputs using a numerical trick based on one-hot kernels and group convolutions.\n\nThe package is useful when you need to express convolutions as matrix-matrix multiplications on higher-dimensional data\u2014a perspective that enables certain optimization techniques and automatic differentiation patterns. It trades some additional peak memory usage for speed gains in both forward and backward passes compared to native PyTorch operations. The package also exposes transpose convolution unfolding (unfoldTransposeNd) and fold operations (foldNd), though fold is tested but not benchmarked.","worth_installing":"Yes, if you work with 3D, 4D, or 5D convolutions and need the im2col perspective for optimization or custom AD. The package is production-stable, actively maintained, has no known vulnerabilities, and offers measurable speed improvements over workarounds. Install only if you actually need higher-dimensional unfold; it's a specialized tool, not a general PyTorch enhancement."},"id":"unfoldnd","links":{"html":"https://skillfed.io/packages/unfoldnd","md":"https://skillfed.io/packages/unfoldnd.md","pypi":"https://pypi.org/project/unfoldnd/"},"maintenance":{"status":"active"},"meta":{"latest_release":"2024-12-30","license_spdx":null,"license_treatment":"permissive","name":"unfoldNd","python_support":"supports_current","summary":"N-dimensional unfold (im2col) and fold (col2im) in PyTorch"},"popularity":{"monthly_downloads":105303,"position":12707,"tier":"top_15000"},"security":{"n_vulnerabilities":0},"version":"0.2.3"}
