depot/third_party/nixpkgs/pkgs/development/python-modules/torchmetrics/default.nix
Default email 94427deb9d Project import generated by Copybara.
GitOrigin-RevId: f91ee3065de91a3531329a674a45ddcb3467a650
2023-05-24 16:37:59 +03:00

78 lines
1.5 KiB
Nix

{ lib
, buildPythonPackage
, fetchFromGitHub
, cloudpickle
, scikit-learn
, scikit-image
, packaging
, psutil
, py-deprecate
, torch
, pytestCheckHook
, torchmetrics
, pytorch-lightning
}:
let
pname = "torchmetrics";
version = "0.11.4";
in
buildPythonPackage {
inherit pname version;
src = fetchFromGitHub {
owner = "PyTorchLightning";
repo = "metrics";
rev = "refs/tags/v${version}";
hash = "sha256-K8QLdDpnS4N8s3zXsifFloRXW/QXEm36mJXXKEBEJBs=";
};
propagatedBuildInputs = [
packaging
py-deprecate
];
# Let the user bring their own instance
buildInputs = [
torch
];
nativeCheckInputs = [
pytorch-lightning
scikit-learn
scikit-image
cloudpickle
psutil
pytestCheckHook
];
# A cyclic dependency in: integrations/test_lightning.py
doCheck = false;
passthru.tests.check = torchmetrics.overridePythonAttrs (_: {
doCheck = true;
});
disabledTestPaths = [
# These require too many "leftpad-level" dependencies
"tests/text"
"tests/audio"
"tests/image"
# A few non-deterministic things like test_check_compute_groups_is_faster
"tests/bases/test_collections.py"
];
pythonImportsCheck = [
"torchmetrics"
];
meta = with lib; {
description = "Machine learning metrics for distributed, scalable PyTorch applications (used in pytorch-lightning)";
homepage = "https://torchmetrics.readthedocs.io";
license = licenses.asl20;
maintainers = with maintainers; [
SomeoneSerge
];
};
}