13 buildPythonPackage rec {
14 pname = "pytorch-metric-learning";
19 src = fetchFromGitHub {
20 owner = "KevinMusgrave";
23 sha256 = "1msvs1j3n47762ahm21bnkk2qqabxw8diiyi7s420x4zg24mr23g";
26 propagatedBuildInputs = [
36 export TEST_DEVICE=cpu
37 export TEST_DTYPES=float32,float64 # half-precision tests fail on CPU
39 # package only requires `unittest`, but use `pytest` to exclude tests
40 checkInputs = [ pytestCheckHook ];
42 # requires FAISS (not in Nixpkgs)
43 "test_accuracy_calculator_and_faiss"
44 # require network access:
45 "test_get_nearest_neighbors"
46 "test_tuplestoweights_sampler"
47 "test_untrained_indexer"
51 description = "Metric learning library for PyTorch";
52 homepage = "https://github.com/KevinMusgrave/pytorch-metric-learning";
53 changelog = "https://github.com/KevinMusgrave/pytorch-metric-learning/releases/tag/v${version}";
54 license = lib.licenses.mit;
55 maintainers = with lib.maintainers; [ bcdarwin ];