2022-01-19 23:45:15 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
2022-06-16 17:23:12 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, pytestCheckHook
|
2022-01-19 23:45:15 +00:00
|
|
|
, pythonOlder
|
2022-09-09 14:08:57 +00:00
|
|
|
, torch
|
2022-01-19 23:45:15 +00:00
|
|
|
, torchvision
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "torchinfo";
|
2023-04-12 12:48:02 +00:00
|
|
|
version = "1.7.2";
|
2022-06-16 17:23:12 +00:00
|
|
|
format = "setuptools";
|
|
|
|
|
2022-01-19 23:45:15 +00:00
|
|
|
disabled = pythonOlder "3.7";
|
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "TylerYep";
|
|
|
|
repo = pname;
|
|
|
|
rev = "refs/tags/v${version}";
|
2023-04-12 12:48:02 +00:00
|
|
|
hash = "sha256-O+I7BNQ5moV/ZcbbuP/IFoi0LO0WsGHBbSfgPmFu1Ec=";
|
2022-01-19 23:45:15 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
2022-09-09 14:08:57 +00:00
|
|
|
torch
|
2022-01-19 23:45:15 +00:00
|
|
|
torchvision
|
|
|
|
];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2022-01-19 23:45:15 +00:00
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
|
|
|
|
disabledTests = [
|
|
|
|
# Skip as it downloads pretrained weights (require network access)
|
|
|
|
"test_eval_order_doesnt_matter"
|
2022-06-16 17:23:12 +00:00
|
|
|
# AssertionError in output
|
|
|
|
"test_google"
|
2022-01-19 23:45:15 +00:00
|
|
|
];
|
|
|
|
|
2023-04-12 12:48:02 +00:00
|
|
|
disabledTestPaths = [
|
|
|
|
# Wants "compressai", which we don't package (2023-03-23)
|
|
|
|
"tests/torchinfo_xl_test.py"
|
|
|
|
];
|
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
pythonImportsCheck = [
|
2023-04-12 12:48:02 +00:00
|
|
|
"torchinfo"
|
2022-06-16 17:23:12 +00:00
|
|
|
];
|
2022-01-19 23:45:15 +00:00
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
meta = with lib; {
|
2022-01-19 23:45:15 +00:00
|
|
|
description = "API to visualize pytorch models";
|
|
|
|
homepage = "https://github.com/TylerYep/torchinfo";
|
2022-06-16 17:23:12 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ petterstorvik ];
|
2022-01-19 23:45:15 +00:00
|
|
|
};
|
|
|
|
}
|