Skip to content

Commit

Permalink
torchvision 0.11.1
Browse files Browse the repository at this point in the history
torchvision 1.11.1

Closes #88950.

Signed-off-by: Sean Molenaar <1484494+SMillerDev@users.noreply.github.com>
Signed-off-by: BrewTestBot <1589480+BrewTestBot@users.noreply.github.com>
  • Loading branch information
ankane authored and BrewTestBot committed Nov 9, 2021
1 parent f18f04b commit 84c489f
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions Formula/torchvision.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
class Torchvision < Formula
desc "Datasets, transforms, and models for computer vision"
homepage "https://github.com/pytorch/vision"
url "https://github.com/pytorch/vision/archive/refs/tags/v0.10.1.tar.gz"
sha256 "4d595cf0214c8adc817f8e3cd0043a027b52b481e05d67b04f4947fcb43d4277"
url "https://github.com/pytorch/vision/archive/refs/tags/v0.11.1.tar.gz"
sha256 "32a06ccf755e4d75006ce03701f207652747a63dbfdf65f0f20a1b6f93a2e834"
license "BSD-3-Clause"

bottle do
Expand Down Expand Up @@ -31,13 +31,23 @@ def install
end

test do
cp pkgshare/"examples/cpp/hello_world/main.cpp", testpath
(testpath/"test.cpp").write <<~EOS
#include <assert.h>
#include <torch/script.h>
#include <torch/torch.h>
#include <torchvision/vision.h>
int main() {
auto& ops = torch::jit::getAllOperatorsFor(torch::jit::Symbol::fromQualString("torchvision::nms"));
assert(ops.size() == 1);
}
EOS
libtorch = Formula["libtorch"]
system ENV.cxx, "-std=c++14", "main.cpp", "-o", "test",
system ENV.cxx, "-std=c++14", "test.cpp", "-o", "test",
"-I#{libtorch.opt_include}",
"-I#{libtorch.opt_include}/torch/csrc/api/include",
"-L#{libtorch.opt_lib}", "-ltorch", "-ltorch_cpu", "-lc10",
"-L#{lib}", "-ltorchvision"
assert_match "[1, 1000]", shell_output("./test")
system "./test"
end
end

0 comments on commit 84c489f

Please sign in to comment.