π π A Python library for audio.
C audioaudio-processingaudio-productionaudio-researchaudio-unitaugmentationjucemachine-learningpybind11pythonvst3vst3-host
Fix TensorFlow test.
Peter Sobot444c6c834015
diff --git a/tests/test_tensorflow.py b/tests/test_tensorflow.pyindex 3e8e09b..c84e80e 100644--- a/tests/test_tensorflow.py+++ b/tests/test_tensorflow.py@@ -32,12 +32,13 @@ def test_can_be_called_in_tensorflow_data_pipeline():import tensorflow as tfsr = 48000- plugins = pedalboard.Pedalboard([pedalboard.Gain(), pedalboard.Reverb()], sample_rate=sr)+ plugins = pedalboard.Pedalboard([pedalboard.Gain(), pedalboard.Reverb()])noise = np.random.rand(sr)ds = tf.data.Dataset.from_tensor_slices([noise]).map(- lambda audio: tf.numpy_function(plugins.process, [audio], tf.float32)+ lambda audio: tf.numpy_function(plugins.process, [audio, sr], tf.float32+ ))model = tf.keras.models.Sequential(@@ -47,4 +48,4 @@ def test_can_be_called_in_tensorflow_data_pipeline():model.compile(loss="mse")model.fit(ds.map(lambda effected: (effected, 1)).batch(1), epochs=10)- assert np.allclose(plugins.process(noise), np.array([tensor.numpy() for tensor in ds]))+ assert np.allclose(plugins(noise, sr), np.array([tensor.numpy() for tensor in ds]))