Skip to content

Commit

Permalink
fixed other mypy bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
wangpatrick57 committed Sep 3, 2024
1 parent 31d4330 commit 10cbfe1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions tune/protox/agent/build_trial.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,9 @@ def _modify_benchbase_config(

def _gen_noise_scale(
vae_config: dict[str, Any], hpo_params: dict[str, Any]
) -> Callable[[ProtoAction, torch.Tensor], ProtoAction]:
def f(p: ProtoAction, n: torch.Tensor) -> ProtoAction:
) -> Callable[[ProtoAction, Optional[torch.Tensor]], ProtoAction]:
def f(p: ProtoAction, n: Optional[torch.Tensor]) -> ProtoAction:
assert n is not None
if hpo_params["scale_noise_perturb"]:
return ProtoAction(
torch.clamp(
Expand Down
2 changes: 1 addition & 1 deletion tune/protox/env/space/latent_space/lsc_index_space.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def __init__(
latent_dim: int = 0,
index_output_transform: Optional[Callable[[ProtoAction], ProtoAction]] = None,
index_noise_scale: Optional[
Callable[[ProtoAction, torch.Tensor], ProtoAction]
Callable[[ProtoAction, Optional[torch.Tensor]], ProtoAction]
] = None,
logger: Optional[Logger] = None,
lsc: Optional[LSC] = None,
Expand Down

0 comments on commit 10cbfe1

Please sign in to comment.