diff --git a/src/omlt/neuralnet/layer.py b/src/omlt/neuralnet/layer.py index 663d7bdd..52d93f11 100644 --- a/src/omlt/neuralnet/layer.py +++ b/src/omlt/neuralnet/layer.py @@ -569,7 +569,7 @@ def __init__( kernel.shape[0], kernel.shape[1], kernel.shape[2] + self.dilations[1] - 1, - kernel.shape[3] + self.dilations[1] - 1 + kernel.shape[3] + self.dilations[1] - 1, ) self.__dilated_kernel = dilate_kernel else: diff --git a/tests/io/test_onnx_parser.py b/tests/io/test_onnx_parser.py index 511c6aaf..1289f3f1 100644 --- a/tests/io/test_onnx_parser.py +++ b/tests/io/test_onnx_parser.py @@ -109,16 +109,16 @@ def test_conv_dilations(datadir): net = load_onnx_neural_network(model) layers = list(net.layers) assert layers[1].dilations == [2, 2] - assert (layers[1].dilated_kernel[0][0].round(8) == array( - [[-0.00886667, 0, 0.18750042], - [0, 0, 0], - [-0.11404419, 0, -0.02588665]] - )).all() - assert (layers[1].dilated_kernel[1][0].round(8) == array( - [[-0.07554907, 0, -0.05939162], - [0, 0, 0], - [0.2217437, 0, 0.14637864]] - )).all() + assert ( + layers[1].dilated_kernel[0][0].round(8) + == array( + [[-0.00886667, 0, 0.18750042], [0, 0, 0], [-0.11404419, 0, -0.02588665]] + ) + ).all() + assert ( + layers[1].dilated_kernel[1][0].round(8) + == array([[-0.07554907, 0, -0.05939162], [0, 0, 0], [0.2217437, 0, 0.14637864]]) + ).all() assert layers[1].pads == [1, 2, 1, 0]