Files
nixpkgs/pkgs/development/python-modules/captum/default.nix
Wolfgang Walther c283f32d29 treewide: remove unused with
Auto-fixed by nixf-diagnose.
2025-10-05 10:50:41 +02:00

80 lines
1.6 KiB
Nix

{
lib,
stdenv,
fetchFromGitHub,
fetchpatch,
buildPythonPackage,
pytestCheckHook,
setuptools,
matplotlib,
numpy,
packaging,
torch,
tqdm,
flask,
flask-compress,
parameterized,
scikit-learn,
}:
buildPythonPackage rec {
pname = "captum";
version = "0.8.0";
pyproject = true;
build-system = [ setuptools ];
src = fetchFromGitHub {
owner = "pytorch";
repo = "captum";
tag = "v${version}";
hash = "sha256-WuKbMYZPHWaTYYhVseSSkwXQk9LBzGuWfmneDw9V2hg=";
};
dependencies = [
matplotlib
numpy
packaging
torch
tqdm
];
pythonRelaxDeps = [
"numpy"
];
pythonImportsCheck = [ "captum" ];
nativeCheckInputs = [
pytestCheckHook
flask
flask-compress
parameterized
scikit-learn
];
disabledTestPaths =
lib.optionals stdenv.hostPlatform.isDarwin [
# These tests may fail if multiple builds run them at the same time due
# to hardcoded port number used for rendezvous
"tests/attr/test_data_parallel.py"
]
++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [
# Issue reported upstream at https://github.com/pytorch/captum/issues/1447
"tests/concept/test_tcav.py"
];
disabledTests = [
# Failing tests
"test_softmax_classification_batch_zero_baseline"
"test_tracin_identity_regression_9_check_idx_none_ArnoldiInfluenceFunction"
];
meta = {
description = "Model interpretability and understanding for PyTorch";
homepage = "https://github.com/pytorch/captum";
license = lib.licenses.bsd3;
maintainers = [ ];
};
}