Skip to content

Commit e73e86a

Browse files
csauperfacebook-github-bot
authored andcommitted
Fix assorted unbound variables [4/n] (#1365)
Summary: Fix unbound variables that flake8 is complaining about Reviewed By: cyrjano Differential Revision: D64261231
1 parent bbeab93 commit e73e86a

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

tests/attr/test_class_summarizer.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,9 @@ def test_classes(self) -> None:
5757
for batch_size in [None, 1, 4]:
5858
for sizes, classes in zip(sizes_to_test, list_of_classes):
5959

60-
def create_batch_labels(batch_idx):
60+
def create_batch_labels(
61+
batch_idx, batch_size=batch_size, classes=classes
62+
):
6163
if batch_size is None:
6264
# batch_size = 1
6365
return classes[batch_idx]

tests/attr/test_input_layer_wrapper.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545

4646
class InputLayerMeta(type):
4747
def __new__(metacls, name: str, bases: Tuple, attrs: Dict):
48+
global layer_methods_to_test_with_equiv
4849
for (
4950
layer_method,
5051
equiv_method,
@@ -56,7 +57,7 @@ def __new__(metacls, name: str, bases: Tuple, attrs: Dict):
5657
+ f"_{equiv_method.__name__}_{multi_layer}"
5758
)
5859
attrs[test_name] = (
59-
lambda self: self.layer_method_with_input_layer_patches(
60+
lambda self, layer_method=layer_method, equiv_method=equiv_method, multi_layer=multi_layer: self.layer_method_with_input_layer_patches( # noqa: E501
6061
layer_method, equiv_method, multi_layer
6162
)
6263
)

0 commit comments

Comments
 (0)