diff --git a/hypothesis_torch/register_random_torch_state.py b/hypothesis_torch/register_random_torch_state.py index 57f44df..99477be 100644 --- a/hypothesis_torch/register_random_torch_state.py +++ b/hypothesis_torch/register_random_torch_state.py @@ -1,5 +1,7 @@ """Register a random.Random-compatible shim for `torch.random` with Hypothesis.""" +from typing import Any, Callable + import hypothesis import hypothesis.internal.entropy import torch @@ -11,6 +13,10 @@ class TorchRandomWrapper: Hypothesis's random state manager requires a random.Random-compatible object. """ + seed: Callable[..., Any] + getstate: Callable[[], Any] + setstate: Callable[..., Any] + def __init__(self) -> None: """Initialize the TorchRandomWrapper.""" self.seed = torch.random.manual_seed