mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-23 23:43:30 +00:00
Merge pull request #263549 from GaetanLepage/torchinfo
python311Packages.torchinfo: 1.64 -> 1.8.0
This commit is contained in:
commit
79f1294137
@ -1,26 +1,38 @@
|
||||
{ lib
|
||||
, buildPythonPackage
|
||||
, fetchFromGitHub
|
||||
, pytestCheckHook
|
||||
, fetchpatch
|
||||
, pythonOlder
|
||||
, torch
|
||||
, torchvision
|
||||
, pytestCheckHook
|
||||
, transformers
|
||||
}:
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "torchinfo";
|
||||
version = "1.64";
|
||||
version = "1.8.0";
|
||||
format = "setuptools";
|
||||
|
||||
disabled = pythonOlder "3.7";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "TylerYep";
|
||||
repo = pname;
|
||||
repo = "torchinfo";
|
||||
rev = "refs/tags/v${version}";
|
||||
hash = "sha256-gcl8RxCD017FP4LtB60WVtOh7jg2Otv/vNd9hKneEAU=";
|
||||
hash = "sha256-pPjg498aT8y4b4tqIzNxxKyobZX01u+66ScS/mee51Q=";
|
||||
};
|
||||
|
||||
patches = [
|
||||
(fetchpatch { # Add support for Python 3.11 and pytorch 2.1
|
||||
url = "https://github.com/TylerYep/torchinfo/commit/c74784c71c84e62bcf56664653b7f28d72a2ee0d.patch";
|
||||
hash = "sha256-xSSqs0tuFpdMXUsoVv4sZLCeVnkK6pDDhX/Eobvn5mw=";
|
||||
includes = [
|
||||
"torchinfo/model_statistics.py"
|
||||
];
|
||||
})
|
||||
];
|
||||
|
||||
propagatedBuildInputs = [
|
||||
torch
|
||||
torchvision
|
||||
@ -28,17 +40,23 @@ buildPythonPackage rec {
|
||||
|
||||
nativeCheckInputs = [
|
||||
pytestCheckHook
|
||||
transformers
|
||||
];
|
||||
|
||||
preCheck = ''
|
||||
export HOME=$(mktemp -d)
|
||||
'';
|
||||
|
||||
disabledTests = [
|
||||
# Skip as it downloads pretrained weights (require network access)
|
||||
"test_eval_order_doesnt_matter"
|
||||
"test_flan_t5_small"
|
||||
# AssertionError in output
|
||||
"test_google"
|
||||
];
|
||||
|
||||
disabledTestPaths = [
|
||||
# Wants "compressai", which we don't package (2023-03-23)
|
||||
# Test requires network access
|
||||
"tests/torchinfo_xl_test.py"
|
||||
];
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user