Skip to content

Commit 2819e27

Browse files
committed
fix style checks and unit tests
Signed-off-by: Farhan Ahmed <[email protected]>
1 parent 50e0be1 commit 2819e27

File tree

3 files changed

+3
-5
lines changed

3 files changed

+3
-5
lines changed

art/estimators/certification/randomized_smoothing/pytorch.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,9 @@
2323
from __future__ import absolute_import, division, print_function, unicode_literals
2424

2525
import logging
26-
from typing import List, Optional, Tuple, Union, Any, TYPE_CHECKING
26+
from typing import List, Optional, Tuple, Union, TYPE_CHECKING
2727

2828
import warnings
29-
import random
3029
from tqdm import tqdm
3130
import numpy as np
3231

art/estimators/regression/pytorch.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
import copy
2525
import logging
2626
import os
27-
import random
2827
import time
2928
from typing import Any, Dict, List, Optional, Tuple, Union, TYPE_CHECKING
3029

@@ -375,7 +374,7 @@ def fit( # pylint: disable=W0221
375374
loss.backward()
376375

377376
self._optimizer.step()
378-
377+
379378
if scheduler is not None:
380379
scheduler.step()
381380

tests/classifiersFrameworks/test_pytorch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ def forward(self, x):
253253
n_samples=10000, n_features=20, n_informative=5, n_redundant=2, n_repeated=0, n_classes=2
254254
)
255255
train_x, test_x, train_y, test_y = sklearn.model_selection.train_test_split(x, y, test_size=0.2)
256-
train_x = test_x.astype(np.float32)
256+
train_x = train_x.astype(np.float32)
257257
train_y = train_y.astype(np.float32)
258258
test_x = test_x.astype(np.float32)
259259
model = BasicModel()

0 commit comments

Comments
 (0)