Skip to content

Commit

Permalink
cool keras fix
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewZhaoLuo committed Oct 22, 2021
1 parent ac152f4 commit 63b8bec
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions python/tvm/relay/frontend/keras.py
Original file line number Diff line number Diff line change
Expand Up @@ -354,11 +354,14 @@ def _convert_convolution(inexpr, keras_layer, etab):
else:
kernel_layout = "HWIO"
else:
kernel_layout = "OIHW"
if is_deconv:
kernel_layout = "IOHW"
else:
kernel_layout = "OIHW"

if is_deconv:
kernel_h, kernel_w, n_filters, in_channels = weight.shape
if kernel_layout == "OIHW":
if kernel_layout == "IOHW":
weight = weight.transpose([3, 2, 0, 1])
elif is_depthconv:
kernel_h, kernel_w, in_channels, depth_mult = weight.shape
Expand Down

0 comments on commit 63b8bec

Please sign in to comment.