Skip to content

Commit

Permalink
Fix recently added tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Uri Granta committed Sep 4, 2024
1 parent 971f559 commit a37ffc7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion tests/unit/models/test_interfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import pytest
import tensorflow as tf
import tensorflow_probability as tfp
from gpflow.keras import tf_keras

from tests.util.misc import assert_datasets_allclose, quadratic, random_seed
from tests.util.models.gpflow.models import (
Expand Down Expand Up @@ -304,7 +305,7 @@ def test_encoded_supports_predict_y() -> None:


def test_encoded_probabilistic_model_keras_embedding() -> None:
encoder = tf.keras.layers.Embedding(3, 2)
encoder = tf_keras.layers.Embedding(3, 2)
model = _EncodedModel(encoder=encoder)
query_points = tf.random.uniform([3, 5], minval=0, maxval=3, dtype=tf.int32)
mean, var = model.predict(query_points)
Expand Down
3 changes: 2 additions & 1 deletion trieste/space.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import tensorflow as tf
import tensorflow_probability as tfp
from check_shapes import check_shapes
from gpflow.keras import tf_keras
from typing_extensions import Protocol, runtime_checkable

from .types import TensorType
Expand Down Expand Up @@ -643,7 +644,7 @@ def encoder(x: TensorType) -> TensorType:
)
columns = tf.split(flat_x, flat_x.shape[-1], axis=1)
encoders = [
tf.keras.layers.CategoryEncoding(num_tokens=len(ts), output_mode="one_hot")
tf_keras.layers.CategoryEncoding(num_tokens=len(ts), output_mode="one_hot")
for ts in self.tags
]
encoded = tf.concat(
Expand Down

0 comments on commit a37ffc7

Please sign in to comment.