balgot / ib031-cifar10

Classifying CIFAR-10 dataset using simple classifiers
0 stars 0 forks source link

Cache #12

Closed balgot closed 4 years ago

balgot commented 4 years ago

cache resuts of the loading_meta function

balgot commented 4 years ago

Might be possible to do it via functools.lru_cache

balgot commented 4 years ago

I didnt know, that dictionary in function preserves its values through multiple function calls. I have just one question, it looks good except of that.

Everything in python is object (that's why in _hash I can use f.__name__) as it preserves its state (lives) throughout the whole program

vargac commented 4 years ago

I didnt know, that dictionary in function preserves its values through multiple function calls. I have just one question, it looks good except of that.

Everything in python is object (that's why in _hash I can use f.__name__) as it preserves its state (lives) throughout the whole program

I remember the trick with mutable object as default argument. I just dont look at python variables this way and so I forgot about it. Thank You. Merging