@giuseros I doesn’t run it, but according to my understanding, these two functions’s inputs should be the same type (tvm.relay.expr). For example, inside the alter_op_layout function we have logic:
# HWIO -> OIHW
kernel_transform = relay.transpose(inputs[1], axes=[3, 2, 0, 1])
# alpha, alpha, CO, CI
weight = relay.nn.contrib_conv2d_winograd_weight_transform(kernel_transform,
tile_size=tile_size)
relay.transpose requires its input’s type is tvm.relay.expr.
For the doc of conv2d_alter_layout
, it says we require tvm.relay.expr too:
@tvm.target.generic_func
def conv2d_alter_layout(attrs, inputs, tinfos, out_type):
"""Change Conv2D layout.
Parameters
----------
attrs : tvm.ir.Attrs
Attributes of current convolution
inputs : tvm.relay.Expr
Grouped input symbols