PyThon

Notes on Python

Documantation

To provide type checking of multiple types use __*Union*__
```Python
from typing import Union, Optional, Tuple
```

Interesting

interesting opencv doc: Here

Pytorch

I don't know for what reason I can not use torch compile. I get not enough SM. ```Python

Compile model for better performance

if torch.cuda.is_available(): model = torch.compile(model) print("Model compilation enabled") I failed also.Python

Enable gradient check-pointing

model_sequential = nn.Sequential(*list(model.children())) model.forward = lambda x: checkpoint_sequential(model_sequential, 2, x) print("Gradient check-pointing enabled") ```

TODO: Read multiprocessing — Process-based parallelism

Path:

Separating path OS independently Python import os path.split(os.sep) All components Yes Simple, but may give '' if path starts with / or drive letter present