• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

bethgelab / foolbox / 8137716344

22 Jan 2024 10:53PM UTC coverage: 98.47%. Remained the same
8137716344

push

github

web-flow
Bump pillow from 10.1.0 to 10.2.0 in /tests (#718)

Bumps [pillow](https://github.com/python-pillow/Pillow) from 10.1.0 to 10.2.0.
- [Release notes](https://github.com/python-pillow/Pillow/releases)
- [Changelog](https://github.com/python-pillow/Pillow/blob/main/CHANGES.rst)
- [Commits](https://github.com/python-pillow/Pillow/compare/10.1.0...10.2.0)

---
updated-dependencies:
- dependency-name: pillow
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

3475 of 3529 relevant lines covered (98.47%)

7.22 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

100.0
/foolbox/models/tensorflow.py
1
from typing import cast, Any
10✔
2
import eagerpy as ep
10✔
3

4
from ..types import BoundsInput, Preprocessing
10✔
5

6
from .base import ModelWithPreprocessing
10✔
7

8

9
def get_device(device: Any) -> Any:
10✔
10
    import tensorflow as tf
2✔
11

12
    if device is None:
2✔
13
        device = tf.device("/GPU:0" if tf.test.is_gpu_available() else "/CPU:0")
2✔
14
    if isinstance(device, str):
2✔
15
        device = tf.device(device)
2✔
16
    return device
2✔
17

18

19
class TensorFlowModel(ModelWithPreprocessing):
10✔
20
    def __init__(
10✔
21
        self,
22
        model: Any,
23
        bounds: BoundsInput,
24
        device: Any = None,
25
        preprocessing: Preprocessing = None,
26
    ):
27
        import tensorflow as tf
2✔
28

29
        if not tf.executing_eagerly():
2✔
30
            raise ValueError(
31
                "TensorFlowModel requires TensorFlow Eager Mode"
32
            )  # pragma: no cover
33

34
        device = get_device(device)
2✔
35
        with device:
2✔
36
            dummy = ep.tensorflow.zeros(0)
2✔
37
        super().__init__(model, bounds, dummy, preprocessing=preprocessing)
2✔
38

39
        self.device = device
2✔
40

41
    @property
10✔
42
    def data_format(self) -> str:
10✔
43
        import tensorflow as tf
2✔
44

45
        return cast(str, tf.keras.backend.image_data_format())
2✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc