code: def register_all(
      keras_objects: bool = True, custom_kernels: bool = True
  ) -> None:
      """Register TensorFlow Addons' objects in TensorFlow global dictionaries.
  
      When loading a Keras model that has a TF Addons' function, it is needed
      for this function to be known by the Keras deserialization process.
  
      There are two ways to do this, either do
  
      ```python
      tf.keras.models.load_model(
          "my_model.tf",
          custom_objects={"LAMB": tfa.image.optimizer.LAMB}
      )
      ```
  
      or you can do:
      ```python
      tfa.register_all()
      tf.keras.models.load_model("my_model.tf")
      ```
  
      If the model contains custom ops (compiled ops) of TensorFlow Addons,
      and the graph is loaded with `tf.saved_model.load`, then custom ops need
      to be registered before to avoid an error of the type:
  
      ```
      tensorflow.python.framework.errors_impl.NotFoundError: Op type not registered
      '...' in binary running on ... Make sure the Op and Kernel are
      registered in the binary running in this process.
      ```
  
      In this case, the only way to make sure that the ops are registered is to call
      this function:
  
      ```python
      tfa.register_all()
      tf.saved_model.load("my_model.tf")
      ```
  
      Note that you can call this function multiple times in the same process,
      it only has an effect the first time. Afterward, it's just a no-op.
  
      Args:
          keras_objects: boolean, `True` by default. If `True`, register all
              Keras objects
              with `tf.keras.utils.register_keras_serializable(package="Addons")`
              If set to False, doesn't register any Keras objects
              of Addons in TensorFlow.
          custom_kernels: boolean, `True` by default. If `True`, loads all
              custom kernels of TensorFlow Addons with
              `tf.load_op_library("path/to/so/file.so")`. Loading the SO files
              register them automatically. If `False` doesn't load and register
              the shared objects files. Not that it might be useful to turn it off
              if your installation of Addons doesn't work well with custom ops.
      Returns:
          None
      """
      if keras_objects:
          register_keras_objects()
      if custom_kernels:
          register_custom_kernels()
  
file_path: addons/tensorflow_addons/register.py
imports: import glob
  from pathlib import Path
  import tensorflow
  from tensorflow_addons.utils.resource_loader import get_path_to_datafile
label_desc: Use image node_id 1 for calling a global function with example usage: register_all(keras_objects, custom_kernels) without return types