Merge pull request #107925 from SuperSandro2000/pytorch

This commit is contained in:
Jörg Thalheim 2020-12-30 06:43:45 +00:00 committed by GitHub
commit 1e7ffa2741
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,30 +1,50 @@
{ buildPythonPackage { stdenv
, fetchPypi , buildPythonPackage
, six , fetchFromGitHub
, ninja
, which
, libjpeg_turbo
, libpng
, numpy , numpy
, scipy
, pillow , pillow
, pytorch , pytorch
, lib , pytest
}: }:
buildPythonPackage rec { buildPythonPackage rec {
version = "0.2.1"; pname = "torchvision";
pname = "torchvision"; version = "0.8.2";
format = "wheel"; src = fetchFromGitHub {
owner = "pytorch";
src = fetchPypi { repo = "vision";
inherit pname version; rev = "v${version}";
format = "wheel"; sha256 = "0yhpbq7linrk2qp5jxsvlgkmwa5bn38s9kcswy4jzvmx1fjbkpq0";
sha256 = "18gvdabkmzfjg47ns0lw38mf85ry28nq1mas5rzlwvb4l5zmw2ms";
}; };
propagatedBuildInputs = [ six numpy pillow pytorch ]; nativeBuildInputs = [ libpng ninja which ];
meta = { TORCHVISION_INCLUDE = "${libjpeg_turbo.dev}/include/";
TORCHVISION_LIBRARY = "${libjpeg_turbo}/lib/";
buildInputs = [ libjpeg_turbo libpng ];
propagatedBuildInputs = [ numpy pillow pytorch scipy ];
# tries to download many datasets for tests
doCheck = false;
checkPhase = ''
HOME=$TMPDIR py.test test --ignore=test/test_datasets_download.py
'';
checkInputs = [ pytest ];
meta = with stdenv.lib; {
description = "PyTorch vision library"; description = "PyTorch vision library";
homepage = "https://pytorch.org/"; homepage = "https://pytorch.org/";
license = lib.licenses.bsd3; license = licenses.bsd3;
maintainers = with lib.maintainers; [ ericsagnes ]; maintainers = with maintainers; [ ericsagnes SuperSandro2000 ];
}; };
} }