Passed
Pull Request — master (#1)
by Konstantinos
59s
created

artificial_artwork.pretrained_model.layers_getter   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 13
dl 0
loc 16
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A VggLayersGetter.id_2_layer() 0 3 1
1
from numpy.typing import NDArray
2
import attr
3
4
from .vgg_architecture import LAYERS
5
6
7
@attr.s
8
class VggLayersGetter:
9
    vgg_layers: NDArray = attr.ib()
10
    _vgg_layer_id_2_layer = attr.ib(init=False,
11
        default=attr.Factory(lambda self: {layer_id: self.vgg_layers[index] for index, layer_id in enumerate(LAYERS)}, takes_self=True))
12
    
13
    @property
14
    def id_2_layer(self):
15
        return self._vgg_layer_id_2_layer
16