Fix Faiss custom_index device
NONE
_The documentation is not available anymore as the PR was closed or merged._
2022-03-22T09:22:46Z
https://github.com/huggingface/datasets/pull/3987#issuecomment-1074923755
https://api.github.com/repos/huggingface/datasets/issues/3987
IC_kwDODunzps5AEgjr
https://api.github.com/repos/huggingface/datasets/issues/comments/1074923755/reactions
2022-03-24T12:18:59Z
https://api.github.com/repos/huggingface/datasets/issues/comments/1074923755
https://avatars.githubusercontent.com/u/99929124?v=4
https://api.github.com/users/HuggingFaceDocBuilderDev/events{/privacy}
https://api.github.com/users/HuggingFaceDocBuilderDev/followers
https://api.github.com/users/HuggingFaceDocBuilderDev/following{/other_user}
https://api.github.com/users/HuggingFaceDocBuilderDev/gists{/gist_id}
https://github.com/HuggingFaceDocBuilderDev
HuggingFaceDocBuilderDev
U_kgDOBfTMJA
https://api.github.com/users/HuggingFaceDocBuilderDev/orgs
https://api.github.com/users/HuggingFaceDocBuilderDev/received_events
https://api.github.com/users/HuggingFaceDocBuilderDev/repos
https://api.github.com/users/HuggingFaceDocBuilderDev/starred{/owner}{/repo}
https://api.github.com/users/HuggingFaceDocBuilderDev/subscriptions
User
https://api.github.com/users/HuggingFaceDocBuilderDev
public
Currently, if both `custom_index` and `device` are passed to `FaissIndex`, `device` is silently ignored.

This PR fixes this by raising a ValueError if both arguments are passed.

Alternatively, the `custom_index` could be transferred to the target `device`.