class_docstr: Abstract base class for optimizer closures in Lightning.
  
  Formally, a closure is binding variables from an external scope to a function that does a computation on these
  variables without taking them explicitly as input. This has the benefit that a closure can be passed to an object
  which later can call it like a function but without requiring to pass in any arguments.
  
  This class provides a simple abstraction making the instance of this class callable like a function while capturing
  the closure result and caching it.
class_docstr_tok: ["Abstract","base","class","for","optimizer","closures","in","Lightning",".","Formally",",","a","closure","is","binding","variables","from","an","external","scope","to","a","function","that","does","a","computation","on","these","variables","without","taking","them","explicitly","as","input",".","This","has","the","benefit","that","a","closure","can","be","passed","to","an","object","which","later","can","call","it","like","a","function","but","without","requiring","to","pass","in","any","arguments",".","This","class","provides","a","simple","abstraction","making","the","instance","of","this","class","callable","like","a","function","while","capturing","the","closure","result","and","caching","it","."]
docstr: Implements the behavior of the closure once it is getting called.
docstr_tok: ["Implements","the","behavior","of","the","closure","once","it","is","getting","called","."]
code: def closure(self, *args: Any, **kwargs: Any) -> T:
      """Implements the behavior of the closure once it is getting called."""
      pass
  
file_path: pytorch-lightning/src/lightning/pytorch/loops/optimization/closure.py
imports: from abc import ABC, abstractmethod
  from dataclasses import dataclass
  from typing import Any, Dict, Generic, Optional, TypeVar
  from lightning.pytorch.utilities.exceptions import MisconfigurationException
label_desc: Use image node_id 3 for calling the AbstractClosure obj's underlying member method code with example usage: obj.closure() without return types