Skip to content

Commit 282f3f3

Browse files
committed
add channels
1 parent 2789011 commit 282f3f3

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

topi/python/topi/intel_graphics/conv2d.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,11 @@ def _alter_conv2d_layout(attrs, inputs, tinfo, F):
159159

160160
copy_inputs = [s for s in inputs]
161161
new_attrs = {k : attrs[k] for k in attrs.keys()}
162+
163+
if F.__name__ == 'tvm.relay.op':
164+
# Derive channels for frontends (e.g ONNX) that miss "channel" field.
165+
new_attrs["channels"] = inputs[1].checked_type.shape[attrs['kernel_layout'].index('O')]
166+
162167
data, kernel = tinfo[0], tinfo[1]
163168
batch_size, in_channel, height, width = get_const_tuple(data.shape)
164169

0 commit comments

Comments
 (0)