• 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 <cstring>
10 
11 #include <executorch/kernels/portable/cpu/util/select_copy_util.h>
12 #include <executorch/runtime/kernel/kernel_includes.h>
13 
14 namespace torch {
15 namespace executor {
16 namespace native {
17 
18 using Tensor = exec_aten::Tensor;
19 
select_copy_int_out(KernelRuntimeContext & ctx,const Tensor & in,int64_t dim,int64_t index,Tensor & out)20 Tensor& select_copy_int_out(
21     KernelRuntimeContext& ctx,
22     const Tensor& in,
23     int64_t dim,
24     int64_t index,
25     Tensor& out) {
26   Error err = torch::executor::select_copy_util(in, dim, index, out);
27   if (err != Error::Ok) {
28     ctx.fail(err);
29   }
30   return out;
31 }
32 
33 } // namespace native
34 } // namespace executor
35 } // namespace torch
36