Summary:
`torch.load` without `weights_only` parameter is unsafe. Explicitly set `weights_only` to False only if you trust the data you load and full pickle functionality is needed, otherwise set `weights_only=True`.
If `weights_only=True` doesn't work for some cases, then explicit `weights_only=False` should be used.
Found with https://github.com/pytorch-labs/torchfix/
Pull Request resolved: https://github.com/facebookresearch/faiss/pull/3796
Reviewed By: asadoughi
Differential Revision: D61824340
Pulled By: kit1980
fbshipit-source-id: bc013d06d4f368f730ffee6898e75fd0b0ff1d40
Summary:
Pull Request resolved: https://github.com/facebookresearch/faiss/pull/3608
This is a straightforward implementation of QINCo in CPU Faiss, with encoding and decoding capabilities (not training).
For this, we translate a simplified version of some torch classes:
- tensors, restricted to 2D and int32 + float32
- Linear and Embedding layer
Then the QINCoStep and QINCo can just be defined as C++ objects that are copy-constructable.
There is some plumbing required in the wrapping layers to support the integration. Pytroch tensors are converted to numpy for getting / setting them in C++.
Reviewed By: asadoughi
Differential Revision: D59132952
fbshipit-source-id: eea4856507a5b7c5f219efcf8d19fe56944df088