class_docstr: A Keras Layer for sparse feature embedding based on CAML.
  
  Example usage:
    feat_embed = SparseFeatureEmbedding(
        de_config, {"first_fea": (10, 1), "second_fea": (5, 1)})
  
    # emb is a [batch_size, 15] Tensor.
    emb = feat_embed({"first_fea": first_tensor, "second_fea": second_tensor})
class_docstr_tok: ["A","Keras","Layer","for","sparse","feature","embedding","based","on","CAML",".","Example","usage",":","feat_embed","=","SparseFeatureEmbedding","(","de_config",",","{","``","first_fea","''",":","(","10",",","1",")",",","``","second_fea","''",":","(","5",",","1",")","}",")","#","emb","is","a","[","batch_size",",","15","]","Tensor",".","emb","=","feat_embed","(","{","``","first_fea","''",":","first_tensor",",","``","second_fea","''",":","second_tensor","}",")"]
code: def build(self, input_shape):
      for name, (embed_dim, sigma_dim) in self._feature_map.items():
          if sigma_dim > 0:
              vc_vec = self.add_weight(
                  name="%s/context_free_vector" % name,
                  shape=[embed_dim],
                  dtype=tf.float32,
                  trainable=True,
                  initializer=tf.keras.initializers.RandomNormal,
              )
              sigma_kernel = self.add_weight(
                  name="%s/sigma_kernel" % name,
                  shape=[sigma_dim],
                  dtype=tf.float32,
                  trainable=True,
                  initializer=tf.keras.initializers.RandomNormal,
              )
              sigma_bias = self.add_weight(
                  name="%s/sigma_bias" % name,
                  shape=[1],
                  dtype=tf.float32,
                  trainable=True,
                  initializer=tf.keras.initializers.zeros,
              )
              self._variable_map[name] = BagOfSparseFeatureVariables(
                  vc_vec, sigma_kernel, sigma_bias
              )
  
imports: import collections
  import threading
  import typing
  from research.carls import dynamic_embedding_config_pb2
  from research.carls import dynamic_embedding_ops
  from six.moves import range
  import tensorflow
label_desc: Use image node_id 3 for calling the SparseFeatureEmbedding obj's underlying member method code with example usage: obj.build(input_shape) without return types