|
|
@ -22,7 +22,8 @@ def create_conv2d(in_channels, out_channels, kernel_size, **kwargs):
|
|
|
|
m = MixedConv2d(in_channels, out_channels, kernel_size, **kwargs)
|
|
|
|
m = MixedConv2d(in_channels, out_channels, kernel_size, **kwargs)
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
depthwise = kwargs.pop('depthwise', False)
|
|
|
|
depthwise = kwargs.pop('depthwise', False)
|
|
|
|
groups = out_channels if depthwise else kwargs.pop('groups', 1)
|
|
|
|
# for DW out_channels must be multiple of in_channels as must have out_channels % groups == 0
|
|
|
|
|
|
|
|
groups = in_channels if depthwise else kwargs.pop('groups', 1)
|
|
|
|
if 'num_experts' in kwargs and kwargs['num_experts'] > 0:
|
|
|
|
if 'num_experts' in kwargs and kwargs['num_experts'] > 0:
|
|
|
|
m = CondConv2d(in_channels, out_channels, kernel_size, groups=groups, **kwargs)
|
|
|
|
m = CondConv2d(in_channels, out_channels, kernel_size, groups=groups, **kwargs)
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|