mirror of
https://github.com/saymrwulf/pytorch.git
synced 2026-05-15 21:00:47 +00:00
10 lines
255 B
C++
10 lines
255 B
C++
#include <catch.hpp>
|
|
|
|
#include <ATen/ATen.h>
|
|
|
|
#include <cmath>
|
|
|
|
TEST_CASE("Tensor/AllocatesTensorOnTheCorrectDevice", "[cuda]") {
|
|
auto tensor = at::tensor({1, 2, 3}, at::device({at::kCUDA, 1}));
|
|
REQUIRE(tensor.device() == at::Device(at::kCUDA, 1));
|
|
}
|