Skip to content

Commit 83c0da5

Browse files
Add alias copy smoke test
Differential Revision: D67866628 Pull Request resolved: #7523
1 parent cd0fcc2 commit 83c0da5

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

kernels/test/op_alias_copy_test.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616
#include <gtest/gtest.h>
1717

1818
using namespace ::testing;
19+
using exec_aten::ScalarType;
20+
using exec_aten::Tensor;
21+
using torch::executor::testing::TensorFactory;
1922

2023
class OpAliasCopyTest : public OperatorTest {
2124
protected:
@@ -25,3 +28,13 @@ class OpAliasCopyTest : public OperatorTest {
2528
return torch::executor::aten::alias_copy_outf(context_, self, out);
2629
}
2730
};
31+
32+
TEST_F(OpAliasCopyTest, SmokeTest) {
33+
TensorFactory<ScalarType::Float> tf;
34+
35+
Tensor a = tf.make({2, 2}, {2, 3, 2, 5});
36+
Tensor out = tf.zeros({2, 2});
37+
38+
op_alias_copy_out(a, out);
39+
EXPECT_TENSOR_EQ(a, out);
40+
}

0 commit comments

Comments
 (0)