提交 60bda33c authored 作者: affanv14's avatar affanv14

skip old cpu convolution if num_groups > 1

上级 a75fe6cb
...@@ -270,6 +270,8 @@ def local_conv3d_cpu(node): ...@@ -270,6 +270,8 @@ def local_conv3d_cpu(node):
return None return None
if node.op.filter_dilation != (1, 1, 1): if node.op.filter_dilation != (1, 1, 1):
return None return None
if node.op.num_groups > 1:
return None
bias = theano.tensor.zeros_like(kern[:, 0, 0, 0, 0]) bias = theano.tensor.zeros_like(kern[:, 0, 0, 0, 0])
...@@ -422,6 +424,8 @@ def local_conv3d_gradweight_cpu(node): ...@@ -422,6 +424,8 @@ def local_conv3d_gradweight_cpu(node):
return None return None
if node.op.filter_dilation != (1, 1, 1): if node.op.filter_dilation != (1, 1, 1):
return None return None
if node.op.num_groups > 1:
return None
# conv3D expects shape (batch, row, column, time, channel) # conv3D expects shape (batch, row, column, time, channel)
img = img.dimshuffle(0, 2, 3, 4, 1) img = img.dimshuffle(0, 2, 3, 4, 1)
...@@ -547,6 +551,8 @@ def local_conv3d_gradinputs_cpu(node): ...@@ -547,6 +551,8 @@ def local_conv3d_gradinputs_cpu(node):
return None return None
if node.op.filter_dilation != (1, 1, 1): if node.op.filter_dilation != (1, 1, 1):
return None return None
if node.op.num_groups > 1:
return None
# need to flip the kernel if necessary (conv3D does not flip) # need to flip the kernel if necessary (conv3D does not flip)
if node.op.filter_flip: if node.op.filter_flip:
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论