Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert Tensor to RaggedTensor in PrepareFeatures for list features #1028

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions merlin/models/tf/transforms/features.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down