parameters: (
      builder, layer, input_names, output_names, keras_layer, respect_train
  )
docstring: Convert a dense layer from keras to coreml.
  
      Parameters
      keras_layer: layer
      ----------
          A keras layer object.
  
      builder: NeuralNetworkBuilder
          A neural network builder object.
      respect_train: boolean
          Whether to support Keras' "trainable" flag (unsupported).
docstring_summary: Convert a dense layer from keras to coreml.
docstring_tokens: Convert a dense layer from keras to coreml .
function: def convert_embedding(
      builder, layer, input_names, output_names, keras_layer, respect_train
  ):
      """Convert a dense layer from keras to coreml.
  
      Parameters
      keras_layer: layer
      ----------
          A keras layer object.
  
      builder: NeuralNetworkBuilder
          A neural network builder object.
      respect_train: boolean
          Whether to support Keras' "trainable" flag (unsupported).
      """
      # Get input and output names
      input_name, output_name = (input_names[0], output_names[0])
  
      # Get the weights from keras
      W = keras_layer.get_weights()[0].T
  
      # assuming keras embedding layers don't have biases
      builder.add_embedding(
          name=layer,
          W=W,
          b=None,
          input_dim=keras_layer.input_dim,
          output_channels=keras_layer.output_dim,
          has_bias=False,
          input_name=input_name,
          output_name=output_name,
      )
  
      if respect_train and keras_layer.trainable:
          logging.warning(
              "Embedding layer '%s' is marked updatable, but Core "
              "ML does not yet support updating layers of this "
              "type. The layer will be frozen in Core ML.",
              layer,
          )
function_tokens: def convert_embedding ( builder , layer , input_names , output_names , keras_layer , respect_train ) : # Get input and output names input_name , output_name = ( input_names [ 0 ] , output_names [ 0 ] ) # Get the weights from keras W = keras_layer . get_weights ( ) [ 0 ] . T # assuming keras embedding layers don't have biases builder . add_embedding ( name = layer , W = W , b = None , input_dim = keras_layer . input_dim , output_channels = keras_layer . output_dim , has_bias = False , input_name = input_name , output_name = output_name , ) if respect_train and keras_layer . trainable : logging . warning ( "Embedding layer '%s' is marked updatable, but Core " "ML does not yet support updating layers of this " "type. The layer will be frozen in Core ML." , layer , )