Skip to content
This repository was archived by the owner on Sep 10, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions .flake8
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
[flake8]
ignore =
E401,E402,E501,E722,W503,W504,F821,B006,B007,B008,B009,
E203 # https://github.com/PyCQA/pycodestyle/issues/373
# https://github.com/PyCQA/pycodestyle/issues/373
E203
select =
B,C,E,F,P,T4,W,B9,
D417 # Missing argument descriptions in the docstring
# Missing argument descriptions in the docstring
D417,
# TorchFix
TOR
max-line-length = 120
exclude = docs/source,third_party
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,6 @@ repos:
- id: flake8
additional_dependencies:
- flake8-docstrings == 1.6.0
- torchfix == 0.0.1
args:
- --config=.flake8
6 changes: 3 additions & 3 deletions test/torchtext_unittest/data/test_jit.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import torch
from torch.testing import assert_allclose
from torch.testing import assert_close
from torchtext.nn import InProjContainer, MultiheadAttentionContainer, ScaledDotProduct

from ..common.torchtext_test_case import TorchtextTestCase
Expand All @@ -26,5 +26,5 @@ def test_torchscript_multiheadattention(self) -> None:

ts_MHA = torch.jit.script(MHA)
ts_mha_output, ts_attn_weights = ts_MHA(query, key, value, attn_mask=attn_mask)
assert_allclose(mha_output, ts_mha_output)
assert_allclose(attn_weights, ts_attn_weights)
assert_close(mha_output, ts_mha_output)
assert_close(attn_weights, ts_attn_weights)