Skip to content

Commit

Permalink
Add slight tolerance term in _check_hypercube (#2679)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #2679

#thanks saitcakmak for helping me debug this

Reviewed By: saitcakmak, SebastianAment

Differential Revision: D68229394

fbshipit-source-id: c9a32dea4c46813f1a48ed3a014f26d3c557f588
  • Loading branch information
mpolson64 authored and facebook-github-bot committed Jan 16, 2025
1 parent 831ea5d commit ff040d0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion botorch/models/kernels/orthogonal_additive_kernel.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,8 @@ def _check_hypercube(x: Tensor, name: str) -> None:
x: Tensor to be checked.
name: Name of the Tensor for the error message.
"""
if (x < 0).any() or (x > 1).any():
tolerance = 1e-6
if (x < -1 * tolerance).any() or (x > 1 + tolerance).any():
raise ValueError(name + " is not in hypercube [0, 1]^d.")


Expand Down

0 comments on commit ff040d0

Please sign in to comment.