Logo
Explore Help
Sign In
public/nixpkgs
1
0
Fork 0
You've already forked nixpkgs
Code Issues Pull Requests Packages Projects Releases Wiki Activity
nixpkgs/pkgs/development/libraries/science/math/libtorch/test/test.cpp

21 lines
301 B
C++
Raw Permalink Normal View History

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.
2020-11-07 13:50:23 +01:00
#undef NDEBUG
#include <cassert>
libtorch-bin: init at 1.6.0
2020-08-27 18:42:38 +02:00
#include <iostream>
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.
2020-11-07 13:50:23 +01:00
#include <torch/torch.h>
libtorch-bin: init at 1.6.0
2020-08-27 18:42:38 +02:00
int main() {
torch::Tensor tensor = torch::eye(3);
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.
2020-11-07 13:50:23 +01:00
float checkData[] = {
1, 0, 0,
0, 1, 0,
0, 0, 1
};
torch::Tensor check = torch::from_blob(checkData, {3, 3});
assert(tensor.allclose(check));
libtorch-bin: init at 1.6.0
2020-08-27 18:42:38 +02:00
}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.23.8 Page: 2855ms Template: 6ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API