Metadata-Version: 2.4
Name: torch-weighttracker
Version: 0.1.0
Summary: Tools for tracking structured weight sparsity in PyTorch models.
License-Expression: MIT
Project-URL: Homepage, https://github.com/dadyownes15/torch-weighttracker
Project-URL: Issues, https://github.com/dadyownes15/torch-weighttracker/issues
Project-URL: Repository, https://github.com/dadyownes15/torch-weighttracker
Keywords: pytorch,torch,weights,tracking,structured-sparsity,pruning
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy>=1.24
Requires-Dist: torch>=2.0
Provides-Extra: structured-bops
Requires-Dist: fvcore; extra == "structured-bops"
Provides-Extra: dev
Requires-Dist: build>=1.2; extra == "dev"
Requires-Dist: fvcore; extra == "dev"
Requires-Dist: pytest>=8.0; extra == "dev"
Requires-Dist: ruff>=0.6; extra == "dev"
Requires-Dist: timm>=1.0; extra == "dev"
Requires-Dist: torchvision>=0.15; extra == "dev"
Requires-Dist: twine>=5.0; extra == "dev"
Dynamic: license-file

# torch-weighttracker

PyTorch tools for tracking structured weight sparsity, regularization signals,
and bit-operation estimates in neural network modules.

The public API is centered on `WeightTracker`:

```python
import torch
from torch import nn

from torch_weighttracker import WeightTracker

model = nn.Sequential(nn.Linear(4, 8), nn.ReLU(), nn.Linear(8, 2))
tracker = WeightTracker(model, example_inputs=torch.randn(1, 4))
print(tracker.view_structures())
```

## Installation

```bash
python -m pip install torch-weighttracker
```

Structured BOPs MAC accounting uses `fvcore` for baseline per-module MACs:

```bash
python -m pip install "torch-weighttracker[structured-bops]"
```

## Development

```bash
python -m pip install -e ".[dev]"
```

Run tests and lint checks:

```bash
pytest
ruff check .
ruff format --check .
```

## Smoke Test

```bash
python -c "from torch_weighttracker import WeightTracker; print(WeightTracker)"
```

## Status

This package is pre-1.0. Public APIs may still change while the tracker,
calculation, and regularizer surfaces settle.

## License

MIT
