MCPcopy Create free account
hub / github.com/MrNeRF/LichtFeld-Studio / TEST

Function TEST

tests/test_torch_conversion.cpp:17–35  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15}
16
17TEST(TorchConversionTest, BasicConversion) {
18 auto lfs_t = lfs::core::Tensor::randn({10, 1}, lfs::core::Device::CUDA);
19
20 // Convert multiple times
21 auto torch_t1 = to_torch(lfs_t);
22 auto torch_t2 = to_torch(lfs_t);
23
24 EXPECT_TRUE(torch_t1.defined());
25 EXPECT_TRUE(torch_t2.defined());
26 EXPECT_TRUE(torch_t1.is_cuda());
27 EXPECT_TRUE(torch_t2.is_cuda());
28
29 // Try sigmoid
30 auto sig1 = torch::sigmoid(torch_t1);
31 auto sig2 = torch::sigmoid(torch_t2);
32
33 EXPECT_TRUE(sig1.defined());
34 EXPECT_TRUE(sig2.defined());
35}

Callers

nothing calls this directly

Calls 3

is_cudaMethod · 0.80
to_torchFunction · 0.70
sigmoidFunction · 0.70

Tested by

no test coverage detected