textgrad.autograd.function#
Classes
|
Represents a context for backward computation. |
|
The class to define a function that can be called and backpropagated through. |
|
Abstract module class with parameters akin to PyTorch's nn.Module. |
- class textgrad.autograd.function.BackwardContext(backward_fn, *args, **kwargs)#
Bases:
object
Represents a context for backward computation.
- Parameters:
backward_fn (callable) – The backward function to be called during backward computation.
args – Variable length argument list to be passed to the backward function.
kwargs – Arbitrary keyword arguments to be passed to the backward function.
- Variables:
backward_fn (callable) – The backward function to be called during backward computation.
fn_name (str) – The fully qualified name of the backward function.
args – Variable length argument list to be passed to the backward function.
kwargs – Arbitrary keyword arguments to be passed to the backward function.
- Method __call__(backward_engine:
EngineLM) -> Any: Calls the backward function with the given backward engine and returns the result.
- Method __repr__() -> str:
Returns a string representation of the BackwardContext object.