Skip to content

Commit 114810d

Browse files
TroyGardenfacebook-github-bot
authored andcommitted
fix pyre error (#2993)
Summary: Pull Request resolved: #2993 # context * add/remove pyre-ignores to fix pyre error * probably due to pyre checker version change somewhere Reviewed By: iamzainhuda Differential Revision: D74944268 fbshipit-source-id: 18a71a2a49aa9ee778a914d9dfba574435fda7b7
1 parent 59fcbcf commit 114810d

File tree

4 files changed

+5
-6
lines changed

4 files changed

+5
-6
lines changed

torchrec/distributed/test_utils/test_input.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -319,10 +319,10 @@ def generate(
319319
# the `_to_copy` (host-to-device) data transfer still blocks cpu execution
320320
float_features = float_features.pin_memory()
321321
label = label.pin_memory()
322-
idlist_features: Optional[KeyedJaggedTensor] = (
322+
idlist_features = (
323323
None if idlist_features is None else idlist_features.pin_memory()
324324
)
325-
idscore_features: Optional[KeyedJaggedTensor] = (
325+
idscore_features = (
326326
None if idscore_features is None else idscore_features.pin_memory()
327327
)
328328
return ModelInput(

torchrec/quant/embedding_modules.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,6 @@ def __init__(
419419

420420
emb_module = IntNBitTableBatchedEmbeddingBagsCodegen(
421421
embedding_specs=embedding_specs,
422-
# pyre-ignore
423422
pooling_mode=pooling_type_to_pooling_mode(pooling),
424423
weight_lists=weight_lists,
425424
device=device,

torchrec/quant/tests/test_embedding_modules.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ def __init__(self, m: torch.nn.Module) -> None:
289289
)
290290
self.assertTrue(isinstance(qebc.m, QuantEmbeddingBagCollection))
291291
# feature name should be consistent with the order of grouped embeddings
292-
self.assertEqual(qebc.m._feature_names, ["f1", "f3", "f2"])
292+
self.assertEqual(qebc.m._feature_names, ["f1", "f3", "f2"]) # pyre-ignore[16]
293293

294294
features = KeyedJaggedTensor(
295295
keys=["f1", "f2", "f3"],
@@ -822,7 +822,7 @@ def __init__(self, m: torch.nn.Module) -> None:
822822
)
823823
self.assertTrue(isinstance(qec.m, QuantEmbeddingCollection))
824824
# feature name should be consistent with the order of grouped embeddings
825-
self.assertEqual(qec.m._feature_names, ["f1", "f3", "f2"])
825+
self.assertEqual(qec.m._feature_names, ["f1", "f3", "f2"]) # pyre-ignore[16]
826826

827827
# pyre-fixme[29]: `Union[Tensor, Module]` is not a function.
828828
configs = model.m.embedding_configs()

torchrec/quant/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def populate_fx_names(
3333
):
3434
table_names = []
3535
for config in emb_configs:
36-
table_names.append(config.name)
36+
table_names.append(config.name) # pyre-ignore[16]
3737
joined_table_names = ",".join(table_names)
3838
# pyre-fixme[16]: `Module` has no attribute `_fx_path`.
3939
emb_module._fx_path = f"emb_module.{joined_table_names}"

0 commit comments

Comments
 (0)