• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) Meta Platforms, Inc. and affiliates.
3  * All rights reserved.
4  *
5  * This source code is licensed under the BSD-style license found in the
6  * LICENSE file in the root directory of this source tree.
7  */
8 
9 #include <executorch/runtime/kernel/kernel_includes.h>
10 
11 namespace torch {
12 namespace executor {
13 namespace native {
14 
15 using executorch::aten::Tensor;
16 using executorch::runtime::KernelRuntimeContext;
17 
view_copy_out(KernelRuntimeContext & ctx,const Tensor & input,const IntArrayRef size,Tensor & out)18 Tensor& view_copy_out(
19     KernelRuntimeContext& ctx,
20     const Tensor& input,
21     const IntArrayRef size,
22     Tensor& out) {
23   memcpy(out.mutable_data_ptr(), input.const_data_ptr(), input.nbytes());
24   return out;
25 }
26 
27 } // namespace native
28 } // namespace executor
29 } // namespace torch
30