commit:     406edac84c9d52bc98c51c828386d4638601d4b2
Author:     Alfredo Tupone <tupone <AT> gentoo <DOT> org>
AuthorDate: Fri Feb 14 22:40:28 2025 +0000
Commit:     Alfredo Tupone <tupone <AT> gentoo <DOT> org>
CommitDate: Fri Feb 14 22:40:44 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=406edac8

sci-libs/torchvision: new package, add 0.20.0

Signed-off-by: Alfredo Tupone <tupone <AT> gentoo.org>

 sci-libs/torchvision/Manifest                  |  1 +
 sci-libs/torchvision/metadata.xml              | 11 ++++
 sci-libs/torchvision/torchvision-0.20.0.ebuild | 74 ++++++++++++++++++++++++++
 3 files changed, 86 insertions(+)

diff --git a/sci-libs/torchvision/Manifest b/sci-libs/torchvision/Manifest
new file mode 100644
index 000000000000..acbb36f56d7e
--- /dev/null
+++ b/sci-libs/torchvision/Manifest
@@ -0,0 +1 @@
+DIST torchvision-0.20.0.tar.gz 13149734 BLAKE2B 
49493f2b088305f2d4a7502201c233304dc149dc96f4da2a3e93341e2d4e094fc6cdbc7c0d60cf25b97e698120065378408b557b2b0237d6afda7d1ed534487d
 SHA512 
1db98fcc0ef4c018cd00a2c540bc60a47dd3b161f5128337e4a2f0bcce792273b9902108dc01e7d091a3331d9e35f8ab53503cbdba3f2a3cb3865471e7f63baf

diff --git a/sci-libs/torchvision/metadata.xml 
b/sci-libs/torchvision/metadata.xml
new file mode 100644
index 000000000000..c79707bc8e29
--- /dev/null
+++ b/sci-libs/torchvision/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd";>
+<pkgmetadata>
+       <maintainer type="person">
+               <email>[email protected]</email>
+               <name>Alfredo Tupone</name>
+       </maintainer>
+       <upstream>
+               <remote-id type="github">pytorch/vision</remote-id>
+       </upstream>
+</pkgmetadata>

diff --git a/sci-libs/torchvision/torchvision-0.20.0.ebuild 
b/sci-libs/torchvision/torchvision-0.20.0.ebuild
new file mode 100644
index 000000000000..4bb2809c1d9d
--- /dev/null
+++ b/sci-libs/torchvision/torchvision-0.20.0.ebuild
@@ -0,0 +1,74 @@
+# Copyright 2024-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{10..12} )
+DISTUTILS_SINGLE_IMPL=1
+DISTUTILS_USE_PEP517=setuptools
+DISTUTILS_EXT=1
+inherit cuda distutils-r1 multiprocessing
+
+DESCRIPTION="Datasets, transforms and models to specific to computer vision"
+HOMEPAGE="https://github.com/pytorch/vision";
+SRC_URI="https://github.com/pytorch/vision/archive/refs/tags/v${PV}.tar.gz
+       -> ${P}.tar.gz"
+
+S="${WORKDIR}"/vision-${PV}
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE="cuda"
+
+RDEPEND="
+       =sci-libs/pytorch-2.5*[${PYTHON_SINGLE_USEDEP}]
+       =sci-libs/caffe2-2.5*[cuda?]
+       dev-python/numpy
+       dev-python/pillow
+       media-libs/libjpeg-turbo:=
+       media-libs/libpng:=
+"
+BDEPEND="
+       test? (
+               $(python_gen_cond_dep '
+                       dev-python/pytest-mock[${PYTHON_USEDEP}]
+                       dev-python/lmdb[${PYTHON_USEDEP}]
+               ')
+       )
+"
+
+src_prepare() {
+       use cuda && cuda_src_prepare
+       distutils-r1_src_prepare
+}
+
+distutils_enable_tests pytest
+
+python_compile() {
+       FORCE_CUDA=$(usex cuda 1 0) \
+               NVCC_FLAGS="${NVCCFLAGS}" \
+               MAX_JOBS="$(makeopts_jobs)" \
+               distutils-r1_python_compile -j1
+}
+
+python_test() {
+       rm -rf torchvision || die
+
+       local EPYTEST_DESELECT=(
+               
test/test_backbone_utils.py::TestFxFeatureExtraction::test_forward_backward
+               
test/test_backbone_utils.py::TestFxFeatureExtraction::test_jit_forward_backward
+               test/test_models.py::test_classification_model
+               
test/test_extended_models.py::TestHandleLegacyInterface::test_pretrained_pos
+               
test/test_extended_models.py::TestHandleLegacyInterface::test_equivalent_behavior_weights
+               test/test_image.py::test_decode_bad_encoded_data
+               test/test_image.py::test_decode_webp
+               test/test_models.py::test_quantized_classification_model
+               test/test_ops.py::test_roi_opcheck
+               
test/test_ops.py::TestDeformConv::test_aot_dispatch_dynamic__test_backward
+               
test/test_ops.py::TestDeformConv::test_aot_dispatch_dynamic__test_forward
+               
test/test_videoapi.py::TestVideoApi::test_frame_reading_mem_vs_file
+               test/test_videoapi.py::TestVideoApi::test_metadata
+       )
+       epytest
+}

Reply via email to