summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorlilac2020-02-15 21:20:20 +0800
committerlilac2020-02-15 21:20:20 +0800
commitc81ac8731ca05798c763d3f7c651a17f8d7d2b58 (patch)
tree148dc370551a6e149b48fcb2cf252da6af391153
parent1353d49cbddab483a6f7cc3decefb161db6263d8 (diff)
downloadaur-c81ac8731ca05798c763d3f7c651a17f8d7d2b58.tar.gz
update by lilac
-rw-r--r--.SRCINFO20
-rw-r--r--PKGBUILD43
2 files changed, 49 insertions, 14 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 79b143b0f94..153a11bc2c5 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = python-torchvision
pkgdesc = Datasets, transforms, and models specific to computer vision
- pkgver = 0.4.2
- pkgrel = 7
+ pkgver = 0.5.0
+ pkgrel = 2
url = https://github.com/pytorch/vision
arch = x86_64
license = BSD
@@ -21,8 +21,20 @@ pkgbase = python-torchvision
depends = python-tqdm
optdepends = ffmpeg: video reader backend (the recommended one with better performance)
optdepends = python-av: video reader backend (the default one)
- source = vision-0.4.2.tar.gz::https://github.com/pytorch/vision/archive/v0.4.2.tar.gz
- sha512sums = 3327364bd1c10f4f0fdf9f8c1bed3848cbd887ee335634a0da6eb7a2611037408eee6261cd178d12225be5f2c809a05ff9fb87420b8accd447a799ca83def3ad
+ source = vision-0.5.0.tar.gz::https://github.com/pytorch/vision/archive/v0.5.0.tar.gz
+ sha512sums = 2b76f7a0f20b7225f6310be358bf4c6fb8cdbc1fa324f53dac3bf6518276755861bd09a91da6cf6a0ff1b466104826b4094e82c796c83b9b4963ca3c0b94d93a
pkgname = python-torchvision
+pkgname = python-torchvision-cuda
+ pkgdesc = Datasets, transforms, and models specific to computer vision (with GPU support)
+ depends = python-numpy
+ depends = python-pillow
+ depends = python-pytorch-cuda
+ depends = python-scipy
+ depends = python-six
+ depends = python-tqdm
+ depends = cuda
+ provides = python-torchvision=0.5.0
+ conflicts = python-torchvision=0.5.0
+
diff --git a/PKGBUILD b/PKGBUILD
index 7aa2040a068..e8fd1283e63 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -4,10 +4,10 @@
# Based on python-torchvision-git; original contributors:
# Contributor: Stephen Zhang <zsrkmyn at gmail dot com>
-pkgname=python-torchvision
+pkgname=('python-torchvision' 'python-torchvision-cuda')
_pkgname=vision
-pkgver=0.4.2
-pkgrel=7
+pkgver=0.5.0
+pkgrel=2
pkgdesc='Datasets, transforms, and models specific to computer vision'
arch=('x86_64')
url='https://github.com/pytorch/vision'
@@ -37,26 +37,49 @@ checkdepends=(
'python-scipy'
)
source=("${_pkgname}-${pkgver}.tar.gz::https://github.com/pytorch/vision/archive/v${pkgver}.tar.gz")
-sha512sums=('3327364bd1c10f4f0fdf9f8c1bed3848cbd887ee335634a0da6eb7a2611037408eee6261cd178d12225be5f2c809a05ff9fb87420b8accd447a799ca83def3ad')
+sha512sums=('2b76f7a0f20b7225f6310be358bf4c6fb8cdbc1fa324f53dac3bf6518276755861bd09a91da6cf6a0ff1b466104826b4094e82c796c83b9b4963ca3c0b94d93a')
get_pyver() {
python -c 'import sys; print(str(sys.version_info[0]) + "." + str(sys.version_info[1]))'
}
+prepare() {
+ cp -a "${srcdir}/${_pkgname}-${pkgver}" "${srcdir}/${_pkgname}-cuda-${pkgver}"
+}
+
build() {
- export FORCE_CUDA=1
- export TORCH_CUDA_ARCH_LIST="3.5;3.7;5.0;5.2;5.3;6.0;6.0+PTX;6.1;6.1+PTX;6.2;6.2+PTX;7.0;7.0+PTX;7.2;7.2+PTX;7.5;7.5+PTX"
- cd "${_pkgname}-${pkgver}"
+ cd "${srcdir}/${_pkgname}-${pkgver}"
+ python setup.py build
+
+ cd "${srcdir}/${_pkgname}-cuda-${pkgver}"
+ FORCE_CUDA=1 \
+ TORCH_CUDA_ARCH_LIST="3.5;3.7;5.0;5.2;5.3;6.0;6.0+PTX;6.1;6.1+PTX;6.2;6.2+PTX;7.0;7.0+PTX;7.2;7.2+PTX;7.5;7.5+PTX" \
python setup.py build
}
check() {
- cd "${_pkgname}-${pkgver}"
+ cd "${srcdir}/${_pkgname}-${pkgver}"
+ PYTHONPATH="${PWD}/build/lib.linux-${CARCH}-$(get_pyver)" pytest -v
+
+ cd "${srcdir}/${_pkgname}-cuda-${pkgver}"
PYTHONPATH="${PWD}/build/lib.linux-${CARCH}-$(get_pyver)" pytest -v
}
-package() {
- cd "${_pkgname}-${pkgver}"
+package_python-torchvision() {
+ cd "${srcdir}/${_pkgname}-${pkgver}"
+ python setup.py install --root="${pkgdir}" --optimize=1 --skip-build
+ install -Dm644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}"
+}
+
+package_python-torchvision-cuda() {
+ pkgdesc='Datasets, transforms, and models specific to computer vision (with GPU support)'
+ depends+=(cuda)
+ provides+=(python-torchvision=${pkgver})
+ conflicts+=(python-torchvision=${pkgver})
+
+ cd "${srcdir}/${_pkgname}-cuda-${pkgver}"
+ FORCE_CUDA=1 \
+ TORCH_CUDA_ARCH_LIST="3.5;3.7;5.0;5.2;5.3;6.0;6.0+PTX;6.1;6.1+PTX;6.2;6.2+PTX;7.0;7.0+PTX;7.2;7.2+PTX;7.5;7.5+PTX" \
python setup.py install --root="${pkgdir}" --optimize=1 --skip-build
install -Dm644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}"
}