14 buildPythonPackage rec {
15 pname = "pytorch-pfn-extras";
18 src = fetchFromGitHub {
21 rev = "refs/tags/v${version}";
22 hash = "sha256-juoLw/qfq4YF7opyR7cTYCVzUa9pXVvQnvGntcQhBr4=";
25 propagatedBuildInputs = [ numpy packaging torch typing-extensions ];
27 nativeCheckInputs = [ onnx pytestCheckHook torchvision ];
29 # ignore all pytest warnings
34 pythonImportsCheck = [ "pytorch_pfn_extras" ];
37 # Requires optuna which is currently (2022-02-16) marked as broken.
38 "tests/pytorch_pfn_extras_tests/test_config_types.py"
40 # requires onnxruntime which was removed because of poor maintainability
41 # See https://github.com/NixOS/nixpkgs/pull/105951 https://github.com/NixOS/nixpkgs/pull/155058
42 "tests/pytorch_pfn_extras_tests/onnx_tests/test_export.py"
43 "tests/pytorch_pfn_extras_tests/onnx_tests/test_torchvision.py"
44 "tests/pytorch_pfn_extras_tests/onnx_tests/utils.py"
45 "tests/pytorch_pfn_extras_tests/onnx_tests/test_lax.py"
47 # RuntimeError: No Op registered for Gradient with domain_version of 9
48 "tests/pytorch_pfn_extras_tests/onnx_tests/test_grad.py"
50 # Requires CUDA access which is not possible in the nix environment.
51 "tests/pytorch_pfn_extras_tests/cuda_tests/test_allocator.py"
52 "tests/pytorch_pfn_extras_tests/nn_tests/modules_tests/test_lazy_batchnorm.py"
53 "tests/pytorch_pfn_extras_tests/nn_tests/modules_tests/test_lazy_conv.py"
54 "tests/pytorch_pfn_extras_tests/nn_tests/modules_tests/test_lazy_linear.py"
55 "tests/pytorch_pfn_extras_tests/nn_tests/modules_tests/test_lazy.py"
56 "tests/pytorch_pfn_extras_tests/profiler_tests/test_record.py"
57 "tests/pytorch_pfn_extras_tests/runtime_tests/test_to.py"
58 "tests/pytorch_pfn_extras_tests/handler_tests/test_handler.py"
59 "tests/pytorch_pfn_extras_tests/test_reporter.py"
60 "tests/pytorch_pfn_extras_tests/training_tests/test_trainer.py"
61 "tests/pytorch_pfn_extras_tests/utils_tests/test_checkpoint.py"
62 "tests/pytorch_pfn_extras_tests/utils_tests/test_comparer.py"
63 "tests/pytorch_pfn_extras_tests/utils_tests/test_new_comparer.py"
64 ] ++ lib.optionals (pythonAtLeast "3.11") [
65 # Remove this when https://github.com/NixOS/nixpkgs/pull/259068 is merged
66 "tests/pytorch_pfn_extras_tests/dynamo_tests/test_compile.py"
70 description = "Supplementary components to accelerate research and development in PyTorch";
71 homepage = "https://github.com/pfnet/pytorch-pfn-extras";
72 license = licenses.mit;
73 maintainers = with maintainers; [ samuela ];