from typing import AnyStr

from torch import Tensor

class UndefinedGrad:
    def __init__(self) -> None: ...
    def __call__(self, *inputs: Tensor) -> list[Tensor]: ...

class DelayedError:
    def __init__(self, msg: AnyStr, num_inputs: int) -> None: ...
    def __call__(self, inputs: list[Tensor]) -> list[Tensor]: ...
