class_docstr: Keras implementation of a KL loss custom layer
class_docstr_tok: ["Keras","implementation","of","a","KL","loss","custom","layer"]
code: def _merge_function(self, inputs):
      mean = inputs[0]
      log_var = inputs[1]
  
      kl = 1.0 + log_var - math_ops.square(mean) - math_ops.exp(log_var)
      kl = -0.5 * math_ops.reduce_mean(kl, axis=-1, keepdims=True)
  
      return kl
  
imports: from pathlib import Path
  import numpy
  import tensorflow
  from tensorflow.python.keras.utils import tf_utils
  from tensorflow.python.ops import math_ops
  import hls4ml
  from hls4ml.converters.keras_to_hls import parse_default_keras_layer
  from hls4ml.model.attributes import ConfigurableAttribute, TypeAttribute
  from hls4ml.model.types import FixedPrecisionType, RoundingMode, SaturationMode
label_desc: Use image node_id 2 for calling the KLLoss obj's underlying member method code with example usage: obj._merge_function(inputs) and returns: kl