You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2020/03/21 12:55:15 UTC

[GitHub] [incubator-tvm] FrozenGene commented on a change in pull request #5080: [KERAS] conv3d frontend operator support

FrozenGene commented on a change in pull request #5080: [KERAS] conv3d frontend operator support
URL: https://github.com/apache/incubator-tvm/pull/5080#discussion_r395990297
 
 

 ##########
 File path: python/tvm/relay/frontend/keras.py
 ##########
 @@ -319,6 +319,75 @@ def _convert_convolution(inexpr, keras_layer, etab):
         out = _convert_activation(out, act_type, etab)
     return out
 
+def _convert_convolution3d(inexpr, keras_layer, etab):
+    _check_data_format(keras_layer)
+    weightList = keras_layer.get_weights()
+    weight = weightList[0]
+
+    if etab.data_layout == 'NDHWC':
+        kernel_layout = 'DHWIO'
+    else:
+        kernel_layout = 'OIDHW'
+        msg = 'Kernel layout with {} is not supported for operator Convolution3D ' \
+              'in frontend Keras.'
+        raise tvm.error.OpAttributeUnImplemented(msg.format(etab.data_layout))
+
+    dilation_rate = keras_layer.dilation_rate
+    if isinstance(dilation_rate, (list, tuple)):
+        dilation = [dilation_rate[0], dilation_rate[1], dilation_rate[2]]
+    else:
+        dilation = [dilation_rate, dilation_rate, dilation_rate]
+
+    kernel_d1 = weight.shape[0]
+    kernel_d2 = weight.shape[1]
+    kernel_d3 = weight.shape[2]
+    # in_channels = weight.shape[3]
 
 Review comment:
   we could uncomment it, though we don't use it.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services