def test_delta():
    'test delta layer'
    specgrams = np.array([1.0, 2.0, 3.0, 4.0], dtype=np.float32)
    specgrams = np.reshape(specgrams, (1, (- 1), 1, 1))
    delta_model = tensorflow.keras.models.Sequential()
    delta_model.add(Delta(win_length=3, input_shape=(4, 1, 1), data_format='channels_last'))
    delta_kapre = delta_model(specgrams)
    delta_ref = np.array([0.5, 1.0, 1.0, 0.5], dtype=np.float32)
    delta_ref = np.reshape(delta_ref, (1, (- 1), 1, 1))
    np.testing.assert_allclose(delta_kapre, delta_ref)
test delta layer
def test_delta():
    
    specgrams = np.array([1.0, 2.0, 3.0, 4.0], dtype=np.float32)
    specgrams = np.reshape(specgrams, (1, (- 1), 1, 1))
    delta_model = tensorflow.keras.models.Sequential()
    delta_model.add(Delta(win_length=3, input_shape=(4, 1, 1), data_format='channels_last'))
    delta_kapre = delta_model(specgrams)
    delta_ref = np.array([0.5, 1.0, 1.0, 0.5], dtype=np.float32)
    delta_ref = np.reshape(delta_ref, (1, (- 1), 1, 1))
    np.testing.assert_allclose(delta_kapre, delta_ref)