Convert separable convolution layer from keras to coreml.

    Parameters
    ----------
    keras_layer: layer
        A keras layer object.

    builder: NeuralNetworkBuilder
        A neural network builder object.

def convert_separable_convolution(builder, layer, input_names, output_names, keras_layer):
    """
    Convert separable convolution layer from keras to coreml.

    Parameters
    ----------
    keras_layer: layer
        A keras layer object.

    builder: NeuralNetworkBuilder
        A neural network builder object.
    """
    _check_data_format(keras_layer)

    # Get input and output names
    input_name, output_name = (input_names[0], output_names[0])

    has_bias = keras_layer.use_bias

    # Get the weights from _keras.
    weight_list = keras_layer.get_weights()
    output_blob_shape = list(filter(None, keras_layer.output_shape))
    output_channels = output_blob_shape[-1]

    # D: depth mutliplier
    # w[0] is (H,W,Cin,D)
    # w[1] is (1,1,Cin * D, Cout)
    W0 = weight_list[0]
    W1 = weight_list[1]
    height, width, input_channels, depth_mult = W0.shape
    b = weight_list[2] if has_bias else None

    W0 = _np.reshape(W0, (height, width, 1, input_channels * depth_mult))

    stride_height, stride_width = keras_layer.strides

    # Dilations
    if (type(keras_layer.dilation_rate) is list) or (type(keras_layer.dilation_rate) is tuple):
        dilations = [keras_layer.dilation_rate[0], keras_layer.dilation_rate[1]]
    else:
        dilations = [keras_layer.dilation_rate, keras_layer.dilation_rate]

    intermediate_name = output_name + '_intermin_'

    builder.add_convolution(name = layer + '_step_1',
             kernel_channels = 1,
             output_channels = input_channels * depth_mult,
             height = height,
             width = width,
             stride_height = stride_height,
             stride_width = stride_width,
             border_mode = keras_layer.padding,
             groups = input_channels,
             W = W0,
             b = None,
             has_bias = False,
             is_deconv = False,
             output_shape = None,
             input_name = input_name,
             output_name = intermediate_name,
             dilation_factors = dilations)

    builder.add_convolution(name = layer + '_step_2',
             kernel_channels = input_channels * depth_mult,
             output_channels = output_channels,
             height = 1,
             width = 1,
             stride_height = 1,
             stride_width = 1,
             border_mode = keras_layer.padding,
             groups = 1,
             W = W1,
             b = b,
             has_bias = has_bias,
             is_deconv = False,
             output_shape = None,
             input_name = intermediate_name,
             output_name = output_name,
             dilation_factors = [1,1])