Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 1a7131a84201
Choose a base ref
...
head repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: d36077239cd5
Choose a head ref
  • 2 commits
  • 3 files changed
  • 1 contributor

Commits on Nov 7, 2020

  1. libtorch-bin: cleanup passthru test

    - Make passthru.tests an attrset.
    - Remove CMake VERBOSE option.
    - Remove spurious `cat CMakeLists.txt`.
    - Run the test as well.
    - Actually test some functionality.
    danieldk committed Nov 7, 2020
    Copy the full SHA
    a71f076 View commit details

Commits on Nov 9, 2020

  1. Merge pull request #103078 from danieldk/cleanup-libtorch-bin-test

    libtorch-bin: cleanup passthru test
    danieldk authored Nov 9, 2020
    Copy the full SHA
    d360772 View commit details
2 changes: 1 addition & 1 deletion pkgs/development/libraries/science/math/libtorch/bin.nix
Original file line number Diff line number Diff line change
@@ -100,7 +100,7 @@ in stdenv.mkDerivation {

outputs = [ "out" "dev" ];

passthru.tests = callPackage ./test { };
passthru.tests.cmake = callPackage ./test { };

meta = with stdenv.lib; {
description = "C++ API of the PyTorch machine learning framework";
Original file line number Diff line number Diff line change
@@ -6,16 +6,12 @@ stdenv.mkDerivation {

src = ./.;

postPatch = ''
cat CMakeLists.txt
'';

makeFlags = [ "VERBOSE=1" ];

nativeBuildInputs = [ cmake ];

buildInputs = [ libtorch-bin ];

doCheck = true;

installPhase = ''
touch $out
'';
17 changes: 15 additions & 2 deletions pkgs/development/libraries/science/math/libtorch/test/test.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,20 @@
#include <torch/torch.h>
#undef NDEBUG
#include <cassert>

#include <iostream>

#include <torch/torch.h>

int main() {
torch::Tensor tensor = torch::eye(3);
std::cout << tensor << std::endl;

float checkData[] = {
1, 0, 0,
0, 1, 0,
0, 0, 1
};

torch::Tensor check = torch::from_blob(checkData, {3, 3});

assert(tensor.allclose(check));
}