Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maintenance #52

Merged
merged 1 commit into from
Nov 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ jobs:
max-parallel: 4
matrix:
python-version: [3.8]
pytorch-version: [1.11.0, 2.1.0]
pytorch-version: [1.11.0, 2.1.1]

steps:
- name: Clone
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Python
uses: actions/setup-python@v4
Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
dependencies = [
"soundfile",
"torch >= 1.11.0",
"torchcrepe >= 0.0.16, <= 0.0.18",
"torchcrepe >= 0.0.16",
"torchlpc >= 0.2.0",
"numpy",
"vector-quantize-pytorch >= 0.8.0",
Expand Down Expand Up @@ -96,4 +96,5 @@
[tool.pytest.ini_options]
filterwarnings = [
"ignore:Casting complex values to real discards the imaginary part",
"ignore:__floordiv__ is deprecated",
]
8 changes: 8 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,11 @@
@pytest.fixture(scope="session", autouse=True)
def scope_session():
torch.set_default_dtype(torch.double)


@pytest.fixture
def float_test():
dtype = torch.get_default_dtype()
torch.set_default_dtype(torch.float)
yield
torch.set_default_dtype(dtype)
4 changes: 2 additions & 2 deletions tests/test_pitch.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

@pytest.mark.parametrize("device", ["cpu", "cuda"])
@pytest.mark.parametrize("out_format", [0, 1, 2])
def test_compatibility(device, out_format, P=80, sr=16000, L=80, H=180):
def test_compatibility(float_test, device, out_format, P=80, sr=16000, L=80, H=180):
pitch = diffsptk.Pitch(P, sr, f_min=L, f_max=H, out_format=out_format, model="tiny")

def eq(o, sr):
Expand Down Expand Up @@ -73,6 +73,6 @@ def inner_eq(y_hat, y):

@pytest.mark.parametrize("device", ["cpu", "cuda"])
@pytest.mark.parametrize("out_format", ["prob", "embed"])
def test_differentiable(device, out_format, P=80, sr=16000, B=2, T=1000):
def test_differentiable(float_test, device, out_format, P=80, sr=16000, B=2, T=1000):
pitch = diffsptk.Pitch(P, sr, out_format=out_format, model="tiny")
U.check_differentiable(device, pitch, [B, T])