From 8502dda8a2dfeb2fc99e1f68fadf065c647c9014 Mon Sep 17 00:00:00 2001 From: Oliver Holworthy Date: Wed, 22 Mar 2023 10:31:25 +0000 Subject: [PATCH] Convert Tensor to RaggedTensor in PrepareFeatures for list features --- merlin/models/tf/transforms/features.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/merlin/models/tf/transforms/features.py b/merlin/models/tf/transforms/features.py index bda89dde9a..1001c153f4 100644 --- a/merlin/models/tf/transforms/features.py +++ b/merlin/models/tf/transforms/features.py @@ -175,6 +175,8 @@ def call(self, inputs: TabularData, **kwargs) -> TabularData: val = inputs[name] elif isinstance(val, tf.SparseTensor): val = tf.RaggedTensor.from_sparse(val) + else: + val = tf.RaggedTensor.from_tensor(val) else: # TODO: Change this condition to check is_ragged after this PR # from Oliver is merged https://github.com/NVIDIA-Merlin/dataloader/pull/103