Skip to content

Commit c227ea0

Browse files
aaudibertensorflow-copybara
authored andcommitted
Migrate to use dataset.cardinality.
The functionality is identical. We plan to deprecate tf.data.experimental.cardinality in the near future, so this will avoid a deprecation warning. PiperOrigin-RevId: 315305120
1 parent e8d9ccd commit c227ea0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

research/kg_hyp_emb/models/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ def eval(self, examples, filters, batch_size=1000):
202202
mean_rank = {}
203203
mean_reciprocal_rank = {}
204204
hits_at = {}
205-
total_examples = tf.data.experimental.cardinality(examples).numpy()
205+
total_examples = examples.cardinality().numpy()
206206
batch_size = min(batch_size, total_examples)
207207
for missing in ['rhs', 'lhs']:
208208
ranks = np.ones(total_examples)

0 commit comments

Comments
 (0)