Skip to content

Commit bec09cd

Browse files
aliafzalmeta-codesync[bot]
authored andcommitted
Code Quality fix [E721] [1/n] (#3410)
Summary: Pull Request resolved: #3410 [E721] compare types, for exact checks use `is` / `is not`, for instance checks use `isinstance()` See https://www.flake8rules.com/rules/E721.htmlArcLint(FLAKE8) Reviewed By: TroyGarden Differential Revision: D83733670 fbshipit-source-id: becbcbcb5a39ae88049fcf414c4d7e33c4999577
1 parent d0e7756 commit bec09cd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

torchrec/modules/tests/test_lazy_extension.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ def forward(self, input: torch.Tensor) -> torch.Tensor:
272272

273273
@torch.no_grad()
274274
def init_weights(m: torch.nn.Module) -> None:
275-
if type(m) == TestModule:
275+
if isinstance(m, TestModule):
276276
m.param.fill_(7.0)
277277

278278
# Case 1: Running `.apply()` without running first forward pass to

0 commit comments

Comments
 (0)