Skip to content

Commit ff040d0

Browse files
mpolson64facebook-github-bot
authored andcommitted
Add slight tolerance term in _check_hypercube (#2679)
Summary: Pull Request resolved: #2679 #thanks saitcakmak for helping me debug this Reviewed By: saitcakmak, SebastianAment Differential Revision: D68229394 fbshipit-source-id: c9a32dea4c46813f1a48ed3a014f26d3c557f588
1 parent 831ea5d commit ff040d0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

botorch/models/kernels/orthogonal_additive_kernel.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,8 @@ def _check_hypercube(x: Tensor, name: str) -> None:
336336
x: Tensor to be checked.
337337
name: Name of the Tensor for the error message.
338338
"""
339-
if (x < 0).any() or (x > 1).any():
339+
tolerance = 1e-6
340+
if (x < -1 * tolerance).any() or (x > 1 + tolerance).any():
340341
raise ValueError(name + " is not in hypercube [0, 1]^d.")
341342

342343

0 commit comments

Comments
 (0)