Skip to content

Commit

Permalink
add default back for session id in NDCG (pytorch#1677)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: pytorch#1677

Add default back to "session_id" if session_key is not set in frontend config.

Reviewed By: fandw06

Differential Revision: D53326155

fbshipit-source-id: 92f88cda589c3ee69003419de424c9c0a53a99b9
  • Loading branch information
iamzainhuda authored and facebook-github-bot committed Feb 1, 2024
1 parent fc7e83d commit cda48a6
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions torchrec/metrics/ndcg.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,9 @@ def __init__(
process_group=process_group,
**kwargs,
)
# session_key is set through front end config
# pyre-ignore[6]
self._required_inputs.add(kwargs["session_key"])
# session_key is set through front end config, default back to "session_id" if does not exist
if "session_key" not in kwargs:
self._required_inputs.add(SESSION_KEY)
else:
# pyre-ignore[6]
self._required_inputs.add(kwargs["session_key"])

0 comments on commit cda48a6

Please sign in to comment.