Skip to content

Commit

Permalink
Fix assorted unbound variables [4/n] (#1365)
Browse files Browse the repository at this point in the history
Summary:

Fix unbound variables that flake8 is complaining about

Reviewed By: cyrjano

Differential Revision: D64261231
  • Loading branch information
csauper authored and facebook-github-bot committed Oct 26, 2024
1 parent b4bf0d7 commit 41dbf46
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion tests/attr/test_class_summarizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ def test_classes(self) -> None:
for batch_size in [None, 1, 4]:
for sizes, classes in zip(sizes_to_test, list_of_classes):

def create_batch_labels(batch_idx):
def create_batch_labels(
batch_idx, batch_size=batch_size, classes=classes
):
if batch_size is None:
# batch_size = 1
return classes[batch_idx]
Expand Down
3 changes: 2 additions & 1 deletion tests/attr/test_input_layer_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@

class InputLayerMeta(type):
def __new__(metacls, name: str, bases: Tuple, attrs: Dict):
global layer_methods_to_test_with_equiv
for (
layer_method,
equiv_method,
Expand All @@ -56,7 +57,7 @@ def __new__(metacls, name: str, bases: Tuple, attrs: Dict):
+ f"_{equiv_method.__name__}_{multi_layer}"
)
attrs[test_name] = (
lambda self: self.layer_method_with_input_layer_patches(
lambda self, layer_method=layer_method, equiv_method=equiv_method, multi_layer=multi_layer: self.layer_method_with_input_layer_patches(
layer_method, equiv_method, multi_layer
)
)
Expand Down

0 comments on commit 41dbf46

Please sign in to comment.