'Tests that the convolution does not introduce a time shift.
We give it a time series, choose a filter that should be the identity,
and assert that the output is not shifted at all relative to the input.'

def testNoTimeShift(self):

    x = np.arange(1, 11, dtype=np.float32)
    x = np.reshape(x, [1, 10, 1])
    filter = np.reshape(np.array([0.0, 1.0], dtype=np.float32), [2, 1, 1])
    x_padded = np.pad(x, [[0, 0], [2, 0], [0, 0]], 'constant')
    out = causal_conv(x_padded, filter, dilation=2)
    with self.test_session() as sess:
        result = sess.run(out)
    self.assertAllEqual(result.shape, x.shape)
    self.assertAllEqual(result, x)
