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

 ##########
 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:
   Ok. Got your meaning.

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to