Skip to content

Commit

Permalink
Fix strided tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lgeiger committed Mar 10, 2020
1 parent 765525a commit c00da9b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions larq/layers_test.py
Expand Up @@ -190,6 +190,11 @@ def test_non_zero_padding_layers(self, layer_cls, input_dim, data_format, dilati
inputs = np.zeros(np.random.randint(5, 20, size=input_dim), np.float32)
kernel = tuple(np.random.randint(3, 7, size=input_dim - 2))
rand_tuple = tuple(np.random.randint(1, 4, size=input_dim - 2))
if not dilation and layer_cls in (
lq.layers.QuantSeparableConv2D,
lq.layers.QuantDepthwiseConv2D,
):
rand_tuple = int(rand_tuple[0])
kwargs = {"dilation_rate": rand_tuple} if dilation else {"strides": rand_tuple}

args = (kernel,) if layer_cls == lq.layers.QuantDepthwiseConv2D else (2, kernel)
Expand Down

0 comments on commit c00da9b

Please sign in to comment.