@@ -2420,6 +2420,27 @@ TEST_F(AtenXlaTensorTest, TestAcoshInPlace) {
24202420 ExpectCounterChanged (" xla::acosh" , cpp_test::GetIgnoredCounters ());
24212421}
24222422
2423+ TEST_F (AtenXlaTensorTest, TestAlias) {
2424+ torch::Tensor a = torch::rand ({2 , 2 }, torch::TensorOptions (torch::kFloat ));
2425+ torch::Tensor b = torch::alias (a);
2426+ ForEachDevice ([&](const torch::Device& device) {
2427+ torch::Tensor xla_a = CopyToDevice (a, device);
2428+ torch::Tensor xla_b = torch::alias (xla_a);
2429+ AllClose (b, xla_b, /* rtol=*/ 1e-3 , /* atol=*/ 0e-5 );
2430+ });
2431+ }
2432+
2433+ TEST_F (AtenXlaTensorTest, TestConj) {
2434+ torch::Tensor a =
2435+ torch::rand ({2 , 2 }, torch::TensorOptions (torch::kComplexFloat ));
2436+ torch::Tensor b = torch::conj (a);
2437+ ForEachDevice ([&](const torch::Device& device) {
2438+ torch::Tensor xla_a = CopyToDevice (a, device);
2439+ torch::Tensor xla_b = torch::conj (xla_a);
2440+ AllClose (b, xla_b, /* rtol=*/ 1e-3 , /* atol=*/ 0e-5 );
2441+ });
2442+ }
2443+
24232444TEST_F (AtenXlaTensorTest, TestCos) {
24242445 torch::Tensor a = torch::rand ({2 , 2 }, torch::TensorOptions (torch::kFloat ));
24252446 torch::Tensor b = torch::cos (a);
0 commit comments