mirror of
https://github.com/wassname/optuna-dashboard.git
synced 2026-09-09 11:28:14 +08:00
flake8
This commit is contained in:
@@ -20,23 +20,6 @@ def test_orthants_MVN_Gibbs_sampling() -> None:
|
||||
assert ret.shape == (3, 2)
|
||||
|
||||
|
||||
def test_one_side_trunc_norm_sampling() -> None:
|
||||
for lower in np.linspace(-10, 10, 100):
|
||||
assert _one_side_trunc_norm_sampling(torch.Tensor([lower])) >= lower
|
||||
|
||||
with patch.object(torch, "rand", return_value=torch.Tensor([0.4])):
|
||||
assert np.allclose(
|
||||
_one_side_trunc_norm_sampling(torch.Tensor([0.1])).numpy(), 0.899967154837563
|
||||
)
|
||||
with patch.object(torch, "rand", return_value=torch.Tensor([0.8])):
|
||||
assert np.allclose(
|
||||
_one_side_trunc_norm_sampling(torch.Tensor([-2.3])).numpy(), -0.8113606739551955
|
||||
)
|
||||
with patch.object(torch, "rand", return_value=torch.Tensor([0.1])):
|
||||
assert np.allclose(
|
||||
_one_side_trunc_norm_sampling(torch.Tensor([5])).numpy(), 5.426934003050024
|
||||
)
|
||||
|
||||
def test_one_side_trunc_norm_sampling() -> None:
|
||||
for lower in np.linspace(-10, 10, 100):
|
||||
assert _one_side_trunc_norm_sampling(torch.tensor([lower], dtype=torch.float64)) >= lower
|
||||
|
||||
Reference in New Issue
Block a user