Skip to content

Commit

Permalink
Fix conti constraint rhs dtype
Browse files Browse the repository at this point in the history
  • Loading branch information
Scienfitz committed May 29, 2024
1 parent 7d0ad61 commit 5b4c462
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions baybe/constraints/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from collections.abc import Sequence
from typing import TYPE_CHECKING, Any, ClassVar

import numpy as np
import pandas as pd
from attr import define, field
from attr.validators import min_len
Expand All @@ -18,6 +19,7 @@
get_base_structure_hook,
unstructure_base,
)
from baybe.utils.numerical import DTypeFloatNumpy

if TYPE_CHECKING:
from torch import Tensor
Expand Down Expand Up @@ -173,11 +175,10 @@ def to_botorch(
if p in param_names
]

# TODO: Cast rhs to correct precision once BoTorch also supports single point.
return (
torch.tensor(param_indices),
torch.tensor(self.coefficients, dtype=DTypeFloatTorch),
self.rhs,
np.asarray(self.rhs, dtype=DTypeFloatNumpy).item(),
)


Expand Down

0 comments on commit 5b4c462

Please sign in to comment.