Skip to content

Conversation

@vaishnavirao24
Copy link

Summary

This PR introduces a minimal example under torchrec/examples/ that demonstrates how to use KeyedJaggedTensor (KJT) in combination with EmbeddingBagCollection (EBC).

Details

  • Sets up dummy user interaction data with a single sparse feature: "movie_id".
  • Constructs a KeyedJaggedTensor using keys, values, and lengths.
  • Passes the KJT through an EmbeddingBagCollection with an EmbeddingBagConfig.
  • Prints the shape of the output embedding (expected: (5, 16)), where 5 is the batch size and 16 is the embedding dimension.

Motivation

This example serves as a clear, minimal reference for new users looking to understand how to integrate KJT with EBC effectively in TorchRec.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jun 21, 2025
@TroyGarden
Copy link
Contributor

suspecting ai-bot work.

@TroyGarden TroyGarden closed this Jun 22, 2025
@vaishnavirao24 vaishnavirao24 deleted the movielens-example branch June 22, 2025 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants