Import Tensorflow graph into Relay "kernel_layout" problem

I had an issue with the “kernel_layout” attribute in the Tensorflow parser that is best described using an example. Below I have a simple Tensorflow graph with an input tensor “X”, a weight tensor “W” and a conv2d_transpose operation with a resulting tensor “y”:

stride=[1,1,2,2] dilations=[1,1,1,1]

X = tf.placeholder(tf.float32, shape=[1,32,64,128]) # ‘NCHW’

W = tf.placeholder(tf.float32, shape=[4,4,19,32]) # ‘HWOI’

y = tf.nn.conv2d_transpose(X, W, [1,32,64,128], strides=stride, data_format=‘NCHW’, padding=‘SAME’)

The original weight layout is in “HWOI” format. When loading the graph into Relay, the weight tensor is transposed that changes its layout to “IOHW”, but the “kernel_layout” for the “conv2d_transpose” operation is set to “OIHW”, based on https://github.com/apache/incubator-tvm/blob/master/python/tvm/relay/frontend/tensorflow.py#L412. The graph is however successfully loaded into Relay as shown below:

def @main(%Placeholder: Tensor[(1, 32, 64, 128), float32], %Placeholder_1: Tensor[(4, 4, 19, 32), float32]) -> Tensor[(1, 19, 128, 256), float32] {

%120 = transpose(%Placeholder_1, axes=[3, 2, 0, 1]) /* ty=Tensor[(32, 19, 4, 4), float32] */;

nn.conv2d_transpose(%Placeholder, %120, channels=19, kernel_size=[4, 4], strides=[2, 2], padding=[1, 1, 1, 1]) /* ty=Tensor[(1, 19, 128, 256), float32] */ }

However, there is a discrepancy between the actual weight layout (“IOHW”) and the “kernel_layout” being passed (“OIHW”) to the “conv2d_transpose” operation. Is this a problem with the code or is it that the “O” and “I” dimension roles are reversed when dealing with the “conv2d_transpose” operation?

Thanks.