Skip to content

Commit

Permalink
Tests should use float32
Browse files Browse the repository at this point in the history
  • Loading branch information
thunn committed Jun 24, 2024
1 parent 1ea286c commit b43fe4a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/test_convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
def test_convert_frequency_to_midi(audio):
"""Test that conversion from Hz to MIDI matches librosa implementation"""

sample_data = torch.tensor([110.0, 220.0, 440.0, 500.0, 880.0])
sample_data = torch.tensor([110.0, 220.0, 440.0, 500.0, 880.0], dtype=torch.float32)

penn_midi = penn.convert.frequency_to_midi(sample_data)

Expand All @@ -23,7 +23,7 @@ def test_convert_frequency_to_midi(audio):
def test_convert_midi_to_frequency(audio):
"""Test that conversion from MIDI to Hz matches librosa implementation"""

sample_data = torch.tensor([45.0, 57.0, 69.0, 71.2131, 81.0])
sample_data = torch.tensor([45.0, 57.0, 69.0, 71.2131, 81.0], dtype=torch.float32)

penn_frequency = penn.convert.midi_to_frequency(sample_data)

Expand Down

0 comments on commit b43fe4a

Please sign in to comment.