From af953ced15294b8023078436e2b304f3eef55c46 Mon Sep 17 00:00:00 2001 From: qthequartermasterman Date: Mon, 13 May 2024 20:32:54 -0500 Subject: [PATCH] docs: :label: improve type hints for internal TorchRandomWrapper object. --- hypothesis_torch/register_random_torch_state.py | 6 ++++++ 1 file changed, 6 insertions(+) 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