depot/third_party/nixpkgs/pkgs/development/python-modules/torchinfo/default.nix
Default email 3a4df29a92 Project import generated by Copybara.
GitOrigin-RevId: 3d7435c638baffaa826b85459df0fff47f12317d
2022-06-16 19:23:12 +02:00

50 lines
965 B
Nix

{ lib
, buildPythonPackage
, fetchFromGitHub
, pytestCheckHook
, pythonOlder
, pytorch
, torchvision
}:
buildPythonPackage rec {
pname = "torchinfo";
version = "1.7.0";
format = "setuptools";
disabled = pythonOlder "3.7";
src = fetchFromGitHub {
owner = "TylerYep";
repo = pname;
rev = "refs/tags/v${version}";
hash = "sha256-SfhFyv5ISbOG3srOK3m9BeSIkA7M8qJTm95GyfdqzcA=";
};
propagatedBuildInputs = [
pytorch
torchvision
];
checkInputs = [
pytestCheckHook
];
disabledTests = [
# Skip as it downloads pretrained weights (require network access)
"test_eval_order_doesnt_matter"
# AssertionError in output
"test_google"
];
pythonImportsCheck = [
"torchvision"
];
meta = with lib; {
description = "API to visualize pytorch models";
homepage = "https://github.com/TylerYep/torchinfo";
license = licenses.mit;
maintainers = with maintainers; [ petterstorvik ];
};
}