From cfe1df0cb86b84ed432ac71f14a5b8fa23a5816e Mon Sep 17 00:00:00 2001 From: Manuel Candales Date: Tue, 14 Jan 2025 09:46:27 -0800 Subject: [PATCH] Add alias copy smoke test (#7523) Summary: Pull Request resolved: https://github.com/pytorch/executorch/pull/7523 Reviewed By: JacobSzwejbka Differential Revision: D67866628 --- kernels/test/op_alias_copy_test.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/kernels/test/op_alias_copy_test.cpp b/kernels/test/op_alias_copy_test.cpp index daa8c52dfb5..e8634a0cb38 100644 --- a/kernels/test/op_alias_copy_test.cpp +++ b/kernels/test/op_alias_copy_test.cpp @@ -16,6 +16,9 @@ #include using namespace ::testing; +using exec_aten::ScalarType; +using exec_aten::Tensor; +using torch::executor::testing::TensorFactory; class OpAliasCopyTest : public OperatorTest { protected: @@ -25,3 +28,13 @@ class OpAliasCopyTest : public OperatorTest { return torch::executor::aten::alias_copy_outf(context_, self, out); } }; + +TEST_F(OpAliasCopyTest, SmokeTest) { + TensorFactory tf; + + Tensor a = tf.make({2, 2}, {2, 3, 2, 5}); + Tensor out = tf.zeros({2, 2}); + + op_alias_copy_out(a, out); + EXPECT_TENSOR_EQ(a, out); +}