Skip to content

Commit

Permalink
dynamically set session_key for session_ids in NDCG (pytorch#1658)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: pytorch#1658

Previously session_key was hardcoded to "session_id" which is unsuitable as all models do not have the same session_key. Now the defined session_key from config will be used as the key instead.

Reviewed By: howei

Differential Revision: D53067426

fbshipit-source-id: e695b5c882eedcb6737168a8f585fbcdf427d590
  • Loading branch information
iamzainhuda authored and facebook-github-bot committed Jan 30, 2024
1 parent 3df9e35 commit 2005d7f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion torchrec/metrics/ndcg.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,4 +307,6 @@ def __init__(
process_group=process_group,
**kwargs,
)
self._required_inputs.add("session_id")
# session_key is set through front end config
# pyre-ignore[6]
self._required_inputs.add(kwargs["session_key"])

0 comments on commit 2005d7f

Please sign in to comment.