1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5
6 # build-system
7 setuptools,
8
9 # dependencies
10 numpy,
11 torch,
12
13 # tests
14 pytestCheckHook,
15}:
16
17buildPythonPackage rec {
18 pname = "ultralytics-thop";
19 version = "2.0.17";
20 pyproject = true;
21
22 src = fetchFromGitHub {
23 owner = "ultralytics";
24 repo = "thop";
25 tag = "v${version}";
26 hash = "sha256-7bNwSbazDlxsaDbyqx2DVhiQ8JgFF3Z+olNLa91jDb4=";
27 };
28
29 build-system = [ setuptools ];
30
31 dependencies = [
32 numpy
33 torch
34 ];
35
36 pythonImportsCheck = [ "thop" ];
37
38 nativeCheckInputs = [ pytestCheckHook ];
39
40 meta = {
41 homepage = "https://github.com/ultralytics/thop";
42 changelog = "https://github.com/ultralytics/thop/releases/tag/${src.tag}";
43 description = "Profile PyTorch models by computing the number of Multiply-Accumulate Operations (MACs) and parameters";
44 license = lib.licenses.agpl3Only;
45 maintainers = with lib.maintainers; [ osbm ];
46 };
47}