Skip to content

Commit ddfdbdc

Browse files
committed
Test coverage for unconditional MVNScore.sample
1 parent d57970a commit ddfdbdc

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

tests/test_scores/test_scores.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,17 @@ def test_mean_score_optimality(mean_score, random_conditions):
4646

4747
assert suboptimal_score > optimal_score
4848
assert keras.ops.isclose(optimal_score, 0)
49+
50+
51+
def test_unconditional_mvn(multivariate_normal_score):
52+
mean = keras.ops.convert_to_tensor([[0.0, 1.0]])
53+
covariance = keras.ops.convert_to_tensor([[[1.0, 0.0], [0.0, 1.0]]])
54+
multivariate_normal_score.sample((10,), mean, covariance)
55+
56+
57+
def test_unconditional_mvn_value_error(multivariate_normal_score):
58+
mean = keras.ops.convert_to_tensor([0.0, 1.0])
59+
covariance = keras.ops.convert_to_tensor([[1.0, 0.0], [0.0, 1.0]])
60+
61+
with pytest.raises(ValueError):
62+
multivariate_normal_score.sample((10,), mean, covariance)

0 commit comments

Comments
 (0)