From 3c771e436bc8f261df669357e9f9ef4c1a58bd7a Mon Sep 17 00:00:00 2001 From: flynhigher Date: Thu, 4 Jul 2024 14:08:16 -0400 Subject: [PATCH] Fix for 'Variable' object has no attribute 'read_value' --- tensorflow_recommenders/layers/factorized_top_k.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tensorflow_recommenders/layers/factorized_top_k.py b/tensorflow_recommenders/layers/factorized_top_k.py index b6a7f451..0316c3cf 100644 --- a/tensorflow_recommenders/layers/factorized_top_k.py +++ b/tensorflow_recommenders/layers/factorized_top_k.py @@ -466,7 +466,7 @@ def top_k(state: Tuple[tf.Tensor, tf.Tensor], def enumerate_rows(batch: tf.Tensor) -> Tuple[tf.Tensor, tf.Tensor]: """Enumerates rows in each batch using a total element counter.""" - starting_counter = self._counter.read_value() + starting_counter = self._counter.value end_counter = self._counter.assign_add(tf.shape(batch)[0]) return tf.range(starting_counter, end_counter), batch