class_docstr: A layer that gets fed its answers from an upstream connection,
  for instance from a component earlier in the pipeline.
docstr: Call the stored _backprop callback, and then
  clears it. This saves memory, as otherwise we hold onto that callback
  until the next batch.
docstr_tok: ["Call","the","stored","_backprop","callback",",","and","then","clears","it",".","This","saves","memory",",","as","otherwise","we","hold","onto","that","callback","until","the","next","batch","."]
code: def backprop_and_clear(self, *args, **kwargs):
      """Call the stored _backprop callback, and then
      clears it. This saves memory, as otherwise we hold onto that callback
      until the next batch.
      """
      if self._backprop is not None:
          result = self._backprop(*args, **kwargs)
      else:
          result = None
      self._batch_id = None
      self._outputs = None
      self._backprop = None
      return result
  
file_path: spacy-transformers/spacy_transformers/layers/listener.py
imports: from typing import Optional, Callable, List
  from thinc.api import Model
  from spacy.errors import Errors
  from spacy.tokens import Doc
  from ..data_classes import TransformerData
label_desc: Use image node_id 4 for calling the TransformerListener obj's underlying member method code with example usage: obj.backprop_and_clear() and returns: result