Skip to content

Commit 7d3a515

Browse files
Ali-Tehranifacebook-github-bot
authored andcommitted
Unify hash_mc_evictions.py (meta-pytorch#3866)
Summary: Context --------- The goal is to remove hash_mc_evictions to unify internal with OSS. Implementation ------------------ - The only difference between internal and OSS, is one assertion statement. - Internal is imported in over 100 different places. - Inside Internal: - Added a simple depreciated warning, and imported from OSS, in this case. - Removed the internal tests: `fb/modules/tests/test_hash_mc_evictions.py` - Changed all internal imports for fb/ within TREC to be OSS. - External imports will be removed in a seperate diff Differential Revision: D96242594
1 parent c874d33 commit 7d3a515

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

torchrec/modules/hash_mc_evictions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ def gen_threshold(self) -> int:
6464
class HashZchSingleTtlScorer(HashZchEvictionScorer):
6565
def gen_score(self, feature: JaggedTensor, device: torch.device) -> torch.Tensor:
6666
assert (
67-
self._config.single_ttl is not None and self._config.single_ttl > 0
68-
), "To use scorer HashZchSingleTtlScorer, a positive single_ttl is required."
67+
self._config.single_ttl is not None
68+
), "To use scorer HashZchSingleTtlScorer, a single_ttl is required."
6969

7070
return torch.full_like(
7171
feature.values(),

0 commit comments

Comments
 (0)