Skip to content

Commit 62f72d7

Browse files
committed
Fix imports
Signed-off-by: Beat Buesser <[email protected]>
1 parent 4183645 commit 62f72d7

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

art/estimators/classification/tensorflow.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,8 @@
2828
import numpy as np
2929
import six
3030

31-
from art.estimators.classification.classifier import ClassGradientsMixin, ClassifierMixin
3231
from art.estimators.tensorflow import TensorFlowV2Estimator
33-
from art.utils import check_and_transform_label_format
32+
from art.estimators.classification.classifier import ClassGradientsMixin, ClassifierMixin
3433

3534
if TYPE_CHECKING:
3635

@@ -224,6 +223,7 @@ def fit(
224223
epoch to adjust the learning rate.
225224
"""
226225
import tensorflow as tf
226+
from art.utils import check_and_transform_label_format
227227

228228
if self._train_step is None: # pragma: no cover
229229
if self._loss_object is None: # pragma: no cover
@@ -449,6 +449,7 @@ def compute_loss(
449449
:return: Array of losses of the same shape as `x`.
450450
"""
451451
import tensorflow as tf
452+
from art.utils import check_and_transform_label_format
452453

453454
if self._loss_object is None: # pragma: no cover
454455
raise TypeError("The loss function `loss_object` is required for computing losses, but it is not defined.")

art/estimators/estimator.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@
2626
import numpy as np
2727
from tqdm.auto import trange
2828

29-
from art.config import ART_NUMPY_DTYPE
30-
3129
if TYPE_CHECKING:
3230
# pylint: disable=cyclic-import
3331
from art.utils import CLIP_VALUES_TYPE, PREPROCESSING_TYPE, ESTIMATOR_TYPE
@@ -192,6 +190,7 @@ def clone_for_refitting(self) -> "ESTIMATOR_TYPE":
192190
raise NotImplementedError
193191

194192
def _check_params(self) -> None:
193+
from art.config import ART_NUMPY_DTYPE
195194
from art.defences.postprocessor.postprocessor import Postprocessor
196195
from art.defences.preprocessor.preprocessor import Preprocessor
197196

art/estimators/generation/tensorflow.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525

2626
import numpy as np
2727

28-
from art.estimators.generation.generator import GeneratorMixin
2928
from art.estimators.tensorflow import TensorFlowV2Estimator
29+
from art.estimators.generation.generator import GeneratorMixin
3030

3131
if TYPE_CHECKING:
3232

art/estimators/tensorflow.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1717
# SOFTWARE.
1818
"""
19-
This module implements the abstract estimators `TensorFlowEstimator` and `TensorFlowV2Estimator` for TensorFlow models.
19+
This module implements the abstract estimators `TensorFlowV2Estimator` for TensorFlow models.
2020
"""
2121
from __future__ import annotations
2222

art/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@
9999
from art.estimators.classification.xgboost import XGBoostClassifier
100100
from art.estimators.certification.deep_z import PytorchDeepZ
101101
from art.estimators.certification.interval import PyTorchIBPClassifier
102-
from art.estimators.certification.derandomized_smoothing.derandomized import BlockAblator, ColumnAblator
102+
from art.estimators.certification.derandomized_smoothing.ablators import BlockAblator, ColumnAblator
103103
from art.estimators.generation.tensorflow import TensorFlowV2Generator
104104
from art.estimators.object_detection.object_detector import ObjectDetector
105105
from art.estimators.object_detection.pytorch_object_detector import PyTorchObjectDetector

0 commit comments

Comments
 (0)