diff --git a/.github/workflows/black.yml b/.github/workflows/black.yml new file mode 100644 index 0000000..9065b5e --- /dev/null +++ b/.github/workflows/black.yml @@ -0,0 +1,10 @@ +name: Lint + +on: [push, pull_request] + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: psf/black@stable diff --git a/README.md b/README.md index c91f618..60e6915 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,6 @@ # Sparsity-preserving gradient utility tools for PyTorch +[![Python tests](https://github.com/cai4cai/torchsparsegradutils/actions/workflows/python-package.yml/badge.svg)](https://github.com/cai4cai/torchsparsegradutils/actions/workflows/python-package.yml) ![License](https://img.shields.io/github/license/cai4cai/torchsparsegradutils) ![Code Style: Black](https://img.shields.io/badge/code%20style-black-000000.svg) + A collection of utility functions to work with PyTorch sparse tensors. This is work-in-progress, here be dragons. Currenly available features with backprop include: diff --git a/torchsparsegradutils/utils/lsmr.py b/torchsparsegradutils/utils/lsmr.py index 979e2b9..1434138 100644 --- a/torchsparsegradutils/utils/lsmr.py +++ b/torchsparsegradutils/utils/lsmr.py @@ -4,6 +4,7 @@ Copyright (C) 2010 David Fong and Michael Saunders """ + import torch diff --git a/torchsparsegradutils/utils/random_sparse.py b/torchsparsegradutils/utils/random_sparse.py index eddcb96..5f3aaaa 100644 --- a/torchsparsegradutils/utils/random_sparse.py +++ b/torchsparsegradutils/utils/random_sparse.py @@ -11,7 +11,7 @@ TODO: This code needs reformatting into just rand_sparse and rand_sparse_tri TODO: Add support for non-strict triangular matrices """ -import warnings + import torch import random from torchsparsegradutils.utils.utils import convert_coo_to_csr_indices_values