Type check error on conv2d_transpose

Hi @AQSingh, thanks for your comment. When I try using groups and channels together I get this error trying to build the relay function:

The Relay type checker is unable to show the following types match: Tensor[(1, 1, 26, 26), float32] Tensor[(1, 256, 26, 26), float32] In particular: dimension 1 conflicts: 1 does not match 256. The Relay type checker is unable to show the following types match. In particular Tensor[(1, 256, 26, 26), float32] does not match Tensor[(1, 1, 26, 26), float32]

The input tensor in this case is (1,256,13,13) and I’m trying to upscale it by 2 (for all 256 channels).

The code:

scale_h = int(2)
scale_w = int(2)
weight = relay.const(np.ones((int(input.checked_type.shape[1]), 1, int(scale_h), int(scale_w))), dtype="float32")
conv2d_transpose = relay.op.nn.conv2d_transpose(input, weight, strides=(int(scale_h), int(scale_w)),  padding=(0,0,0,0), groups=int(input.checked_type.shape[1]), channels=int(input.checked_type.shape[1]))

Though out of frustration I tried many combinations of parameters and it worked for the following combination:

    conv2d_transpose = relay.op.nn.conv2d_transpose(input, weight, strides=(int(scale_h), int(scale_w)), padding=(0,0), dilation=(1,1), groups=int(input.checked_type.shape[1]), channels=int(input.checked_type.shape[1]), kernel_size=(2,2), data_layout="NCHW", kernel_layout="IOHW") 

I guess it has something to do with the data_layout and kernel_layout stated explicitly. What do you think? Looking at the conv2d_transpose implementation I feel like it misses some cases…