systemml-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Niketan Pansare" <>
Subject Re: `conv2d_backward_data()` received "Incorrect dimensions" error. Thanks
Date Wed, 18 Jul 2018 17:53:57 GMT

Hi Janardhan,

The error is due to incorrect usage of the builtin function. The first
parameter should be the filter matrix and second parameter should be the
error matrix from the next layer. Note: the error matrix will be same size
as the input matrix only in case of same padding. From

   For the SAME padding, the output height and width are computed as:
out_height = ceil(float(in_height) / float(strides[1]))
out_width = ceil(float(in_width) / float(strides[2]))
   For the VALID padding, the output height and width are computed as:
out_height = ceil(float(in_height - filter_height + 1) / float(strides[1]))
out_width = ceil(float(in_width - filter_width + 1) / float(strides[2]))

I would also recommend checking out our nn library (
) and DML documentation (


Niketan Pansare
IBM Almaden Research Center
E-mail: npansar At

From:	Janardhan <>
Date:	07/18/2018 07:16 AM
Subject:	`conv2d_backward_data()` received "Incorrect dimensions" error.

Hi, I used the following code same as found in reference. I am receiving
error as ` Incorrect dimensions in DnnOp: 25 != 9`

C = 1; H = 5; W = 5
input = matrix(seq(1, C*H*W), rows=1, cols=C*H*W)
filter = matrix(seq(1, C*3*3), rows=1, cols=C*3*3)
output = conv2d_backward_data(input, filter, stride=[1,1],
padding=[1,1], input_shape=[1,C,H,W], filter_shape=[1,C,3,3])
print(toString(matrix(output, rows=5, cols=5)))

I do not fully know about this function works, please accept sorry if the
report is incorrect.

Thank you,

  • Unnamed multipart/related (inline, None, 0 bytes)
View raw message