| 237 | // ============================================================================ |
| 238 | |
| 239 | TEST_F(TensorVsTorchTest, BasicCreation) { |
| 240 | // Test zeros |
| 241 | auto torch_zeros = torch::zeros({10, 5}, torch::kCUDA); |
| 242 | auto gs_zeros = lfs::core::Tensor::zeros({10, 5}, lfs::core::Device::CUDA); |
| 243 | EXPECT_TRUE(tensors_equal(torch_zeros, gs_zeros)); |
| 244 | |
| 245 | // Test ones |
| 246 | auto torch_ones = torch::ones({10, 5}, torch::kCUDA); |
| 247 | auto gs_ones = lfs::core::Tensor::ones({10, 5}, lfs::core::Device::CUDA); |
| 248 | EXPECT_TRUE(tensors_equal(torch_ones, gs_ones)); |
| 249 | |
| 250 | // Test full |
| 251 | auto torch_full = torch::full({10, 5}, 3.14f, torch::kCUDA); |
| 252 | auto gs_full = lfs::core::Tensor::full({10, 5}, 3.14f, lfs::core::Device::CUDA); |
| 253 | EXPECT_TRUE(tensors_equal(torch_full, gs_full)); |
| 254 | } |
| 255 | |
| 256 | TEST_F(TensorVsTorchTest, RandInt) { |
| 257 | // Test randint with same seed |
nothing calls this directly
no test coverage detected