code: def convert_batchnorm(
      builder,
      layer,
      input_names,
      output_names,
      keras_layer,
      respect_train,
  ):
      """
      Convert a Batch Normalization layer.
  
      Parameters
      keras_layer: layer
          A keras layer object.
  
      builder: NeuralNetworkBuilder
          A neural network builder object.
      respect_train: boolean
          Whether to honor Keras' "trainable" flag (unsupported).
      """
  
      # Get input and output names
      input_name, output_name = (input_names[0], output_names[0])
  
      axis = keras_layer.axis
      nb_channels = keras_layer.input_shape[axis]
  
      # Set parameters
      # Parameter arrangement in Keras: gamma, beta, mean, variance
      idx = 0
      gamma, beta = None, None
      if keras_layer.scale:
          gamma = keras_layer.get_weights()[idx]
          idx += 1
      if keras_layer.center:
          beta = keras_layer.get_weights()[idx]
          idx += 1
      mean = keras_layer.get_weights()[idx]
      std = keras_layer.get_weights()[idx + 1]
  
      gamma = _np.ones(mean.shape) if gamma is None else gamma
      beta = _np.zeros(mean.shape) if beta is None else beta
  
      # compute adjusted parameters
      variance = std * std
      f = 1.0 / _np.sqrt(std + keras_layer.epsilon)
      gamma1 = gamma * f
      beta1 = beta - gamma * mean * f
      mean[:] = 0.0  # mean
      variance[:] = 1.0 - 0.00001  # stddev
  
      builder.add_batchnorm(
          name=layer,
          channels=nb_channels,
          gamma=gamma1,
          beta=beta1,
          mean=mean,
          variance=variance,
          input_name=input_name,
          output_name=output_name,
      )
  
      if respect_train and keras_layer.trainable:
          logging.warning(
              "BatchNorm 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,
          )
  
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 13 for calling a global function with example usage: convert_batchnorm(builder, layer, input_names, output_names, keras_layer, respect_train) without return types