49 lines
1.0 KiB
Nix
Raw Normal View History

2020-12-30 00:04:35 +01:00
{ stdenv
, buildPythonPackage
, fetchFromGitHub
, ninja
, which
, libjpeg_turbo
, libpng
2017-08-19 16:47:23 +09:00
, numpy
2020-12-30 00:04:35 +01:00
, scipy
2017-08-19 16:47:23 +09:00
, pillow
, pytorch
2020-12-30 00:04:35 +01:00
, pytestCheckHook
}:
2017-08-19 16:47:23 +09:00
buildPythonPackage rec {
2020-12-30 00:04:35 +01:00
pname = "torchvision";
version = "0.8.2";
2017-08-19 16:47:23 +09:00
2020-12-30 00:04:35 +01:00
src = fetchFromGitHub {
owner = "pytorch";
repo = "vision";
rev = "v${version}";
sha256 = "0yhpbq7linrk2qp5jxsvlgkmwa5bn38s9kcswy4jzvmx1fjbkpq0";
2017-08-19 16:47:23 +09:00
};
2020-12-30 00:04:35 +01:00
nativeBuildInputs = [ libpng ninja which ];
TORCHVISION_INCLUDE="${libjpeg_turbo.dev}/include/";
TORCHVISION_LIBRARY="${libjpeg_turbo}/lib/";
buildInputs = [ libjpeg_turbo libpng ];
propagatedBuildInputs = [ numpy pillow pytorch scipy ];
# checks fail to import _C.so and various other failures
doCheck = false;
checkInputs = [ pytestCheckHook ];
pytestFlagsArray = [ "--ignore=test/test_datasets_download.py" ];
2017-08-19 16:47:23 +09:00
2020-12-30 00:04:35 +01:00
meta = with stdenv.lib; {
2017-08-19 16:47:23 +09:00
description = "PyTorch vision library";
2020-12-30 00:04:35 +01:00
homepage = "https://pytorch.org/";
license = licenses.bsd3;
maintainers = with maintainers; [ ericsagnes SuperSandro2000 ];
2017-08-19 16:47:23 +09:00
};
}