class_docstr: Linear chain conditional random field (CRF).
  
  Inherits from: `tf.keras.layers.Layer`.
  
  References:
      - [Conditional Random Field](https://en.wikipedia.org/wiki/Conditional_random_field)
  
  Example:
  
  >>> layer = tfa.layers.CRF(4)
  >>> inputs = np.random.rand(2, 4, 8).astype(np.float32)
  >>> decoded_sequence, potentials, sequence_length, chain_kernel = layer(inputs)
  >>> decoded_sequence.shape
  TensorShape([2, 4])
  >>> potentials.shape
  TensorShape([2, 4, 4])
  >>> sequence_length
  <tf.Tensor: shape=(2,), dtype=int64, numpy=array([4, 4])>
  >>> chain_kernel.shape
  TensorShape([4, 4])
  
  Args:
      units: Positive integer, dimensionality of the reservoir.
      chain_initializer: Orthogonal matrix. Default to `orthogonal`.
      use_boundary: `Boolean`, whether the layer uses a boundary vector. Default to `True`.
      boundary_initializer: Tensors initialized to 0. Default to `zeros`.
      use_kernel: `Boolean`, whether the layer uses a kernel weights. Default to `True`.
  Call Args:
      inputs: Positive integer, dimensionality of the output space.
      mask: A boolean `Tensor` of shape `[batch_size, sequence_length]`
          or `None`. Default to `None`.
  Raises:
      ValueError: If input mask doesn't have dim 2 or None.
      NotImplementedError: If left padding is provided.
class_docstr_tok: ["Linear","chain","conditional","random","field","(","CRF",")",".","Inherits","from",":","`","tf.keras.layers.Layer","`",".","References",":","-","[","Conditional","Random","Field","]","(","https",":","\/\/en.wikipedia.org\/wiki\/Conditional_random_field",")","Example",":",">",">",">","layer","=","tfa.layers.CRF","(","4",")",">",">",">","inputs","=","np.random.rand","(","2",",","4",",","8",")",".astype","(","np.float32",")",">",">",">","decoded_sequence",",","potentials",",","sequence_length",",","chain_kernel","=","layer","(","inputs",")",">",">",">","decoded_sequence.shape","TensorShape","(","[","2",",","4","]",")",">",">",">","potentials.shape","TensorShape","(","[","2",",","4",",","4","]",")",">",">",">","sequence_length","<","tf.Tensor",":","shape=","(","2",",",")",",","dtype=int64",",","numpy=array","(","[","4",",","4","]",")",">",">",">",">","chain_kernel.shape","TensorShape","(","[","4",",","4","]",")","Args",":","units",":","Positive","integer",",","dimensionality","of","the","reservoir",".","chain_initializer",":","Orthogonal","matrix",".","Default","to","`","orthogonal","`",".","use_boundary",":","`","Boolean","`",",","whether","the","layer","uses","a","boundary","vector",".","Default","to","`","True","`",".","boundary_initializer",":","Tensors","initialized","to","0",".","Default","to","`","zeros","`",".","use_kernel",":","`","Boolean","`",",","whether","the","layer","uses","a","kernel","weights",".","Default","to","`","True","`",".","Call","Args",":","inputs",":","Positive","integer",",","dimensionality","of","the","output","space",".","mask",":","A","boolean","`","Tensor","`","of","shape","`","[","batch_size",",","sequence_length","]","`","or","`","None","`",".","Default","to","`","None","`",".","Raises",":","ValueError",":","If","input","mask","does","n't","have","dim","2","or","None",".","NotImplementedError",":","If","left","padding","is","provided","."]
code: def get_config(self):
      # used for loading model from disk
      config = {
          "units": self.units,
          "chain_initializer": tf.keras.initializers.serialize(
              self.chain_initializer
          ),
          "use_boundary": self.use_boundary,
          "boundary_initializer": tf.keras.initializers.serialize(
              self.boundary_initializer
          ),
          "use_kernel": self.use_kernel,
      }
      base_config = super().get_config()
      return {**base_config, **config}
  
file_path: addons/tensorflow_addons/layers/crf.py
imports: import tensorflow
  from typeguard import typechecked
  from tensorflow_addons.text.crf import crf_decode
  from tensorflow_addons.utils import types
label_desc: Use image node_id 9 for calling the CRF obj's underlying member method code with example usage: obj.get_config() and returns: dict