code: def convert_dense(
      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 or not to carry over Keras' "trainable" parameter.
      """
      # 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
      W = keras_layer.get_weights()[0].T
      Wb = keras_layer.get_weights()[1].T if has_bias else None
      output_channels, input_channels = W.shape
  
      builder.add_inner_product(
          name=layer,
          W=W,
          b=Wb,
          input_channels=input_channels,
          output_channels=output_channels,
          has_bias=has_bias,
          input_name=input_name,
          output_name=output_name,
      )
      if respect_train and keras_layer.trainable:
          builder.make_updatable([layer])
  
imports: from .None import _utils
  import logging
  import keras
  import numpy
  from ...proto import NeuralNetwork_pb2
  from distutils.version import StrictVersion
label_desc: Use image node_id 6 for calling a global function with example usage: convert_dense(builder, layer, input_names, output_names, keras_layer, respect_train) without return types