code: def batch_norm_dnn(layer, **kwargs):
      """
      Apply cuDNN batch normalization to an existing layer. This is a drop-in
      replacement for :func:`lasagne.layers.batch_norm`; see there for further
      information.
  
      Parameters
      ----------
      layer : A :class:`Layer` instance
          The layer to apply the normalization to; note that it will be
          modified as specified in :func:`lasagne.layers.batch_norm`
      **kwargs
          Any additional keyword arguments are passed on to the
          :class:`BatchNormDNNLayer` constructor.
  
      Returns
      -------
      BatchNormDNNLayer or NonlinearityLayer instance
          A batch normalization layer stacked on the given modified `layer`, or
          a nonlinearity layer stacked on top of both if `layer` was nonlinear.
      """
      nonlinearity = getattr(layer, "nonlinearity", None)
      if nonlinearity is not None:
          layer.nonlinearity = nonlinearities.identity
      if hasattr(layer, "b") and layer.b is not None:
          del layer.params[layer.b]
          layer.b = None
      bn_name = kwargs.pop("name", None) or (
          getattr(layer, "name", None) and layer.name + "_bn"
      )
      layer = BatchNormDNNLayer(layer, name=bn_name, **kwargs)
      if nonlinearity is not None:
          from .special import NonlinearityLayer
  
          nonlin_name = bn_name and bn_name + "_nonlin"
          layer = NonlinearityLayer(
              layer, nonlinearity, name=nonlin_name
          )
      return layer
  
imports: import warnings
  import theano
  from ..None import init
  from ..None import nonlinearities
  from .base import Layer
  from .conv import conv_output_length, BaseConvLayer
  from .pool import pool_output_length
  from .normalization import BatchNormLayer
  from ..utils import as_tuple
label_desc: Use image node_id 1 for calling a global function with example usage: batch_norm_dnn(layer) and returns: layer