code: def remove_interpretable_embedding_layer(
      model: Module, interpretable_emb: InterpretableEmbeddingBase
  ) -> None:
      r"""
      Removes interpretable embedding layer and sets back original
      embedding layer in the model.
  
      Args:
  
          model (torch.nn.Module): An instance of PyTorch model that contains embeddings
          interpretable_emb (InterpretableEmbeddingBase): An instance of
                      `InterpretableEmbeddingBase` that was originally created in
                      `configure_interpretable_embedding_layer` function and has
                      to be removed after interpretation is finished.
  
      Examples::
  
                  >>> # Let's assume that we have a DocumentClassifier model that
                  >>> # has a word embedding layer named 'embedding'.
                  >>> # To make that layer interpretable we need to execute the
                  >>> # following command:
                  >>> net = DocumentClassifier()
                  >>> interpretable_emb = configure_interpretable_embedding_layer(net,
                  >>>    'embedding')
                  >>> # then we can use interpretable embedding to convert our
                  >>> # word indices into embeddings.
                  >>> # Let's assume that we have the following word indices
                  >>> input_indices = torch.tensor([1, 0, 2])
                  >>> # we can access word embeddings for those indices with the command
                  >>> # line stated below.
                  >>> input_emb = interpretable_emb.indices_to_embeddings(input_indices)
                  >>> # Let's assume that we want to apply integrated gradients to
                  >>> # our model and that target attribution class is 3
                  >>> ig = IntegratedGradients(net)
                  >>> attribution = ig.attribute(input_emb, target=3)
                  >>> # after we finish the interpretation we need to remove
                  >>> # interpretable embedding layer with the following command:
                  >>> remove_interpretable_embedding_layer(net, interpretable_emb)
  
      """
      _set_deep_layer_value(
          model,
          interpretable_emb.full_name,
          interpretable_emb.embedding,
      )
  
file_path: captum/captum/attr/_models/base.py
imports: import warnings
  from functools import reduce
  import torch
  from torch.nn import Module
label_desc: Use image node_id 4 for calling a global function with example usage: remove_interpretable_embedding_layer(model, interpretable_emb) without return types