Conversation

vaishnavirao24

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-botfacebook--bot added the CLA SignedThis label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.label Jun 21, 2025
@TroyGarden

suspecting ai-bot work.

@vaishnavirao24vaishnavirao24 deleted the movielens-example branch June 22, 2025 15:15
Sign up for free to join this conversation on . Already have an account? Sign in to comment
CLA SignedThis label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
None yet

Successfully merging this pull request may close these issues.