48 lines
942 B
Nix

{
lib,
buildPythonPackage,
fetchFromGitHub,
# build-system
setuptools,
# dependencies
numpy,
torch,
# tests
pytestCheckHook,
}:
buildPythonPackage rec {
pname = "ultralytics-thop";
version = "2.0.14";
pyproject = true;
src = fetchFromGitHub {
owner = "ultralytics";
repo = "thop";
tag = "v${version}";
hash = "sha256-Xn01zh0/oaMPqH0FPDKElE0q7di3sDrXYcXCg6I/89E=";
};
build-system = [ setuptools ];
dependencies = [
numpy
torch
];
pythonImportsCheck = [ "thop" ];
nativeCheckInputs = [ pytestCheckHook ];
meta = {
homepage = "https://github.com/ultralytics/thop";
changelog = "https://github.com/ultralytics/thop/releases/tag/v${version}";
description = "Profile PyTorch models by computing the number of Multiply-Accumulate Operations (MACs) and parameters";
license = lib.licenses.agpl3Only;
maintainers = with lib.maintainers; [ osbm ];
};
}