mirror of
https://github.com/pytorch/pytorch.git
synced 2026-11-20 09:04:25 +08:00
11 lines
255 B
C++
11 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));
|
|
}
|