1 // Copyright (c) Facebook, Inc. and its affiliates.
2 // All rights reserved.
3 //
4 // This source code is licensed under the BSD-style license found in the
5 // LICENSE file in the root directory of this source tree.
6
7 #include <ATen/Operators.h>
8 #include <ATen/core/dispatch/Dispatcher.h>
9 #include <ATen/functorch/BatchRulesHelper.h>
10
11 namespace at { namespace functorch {
12
13 #define OP_DECOMPOSE(op) m.impl(#op, static_cast<decltype(&ATEN_FN(op))>(native::op));
14 #define OP_DECOMPOSE2(op, overload) m.impl(#op"."#overload, static_cast<decltype(&ATEN_FN2(op, overload))>(native::op));
15
TORCH_LIBRARY_IMPL(aten,FuncTorchBatched,m)16 TORCH_LIBRARY_IMPL(aten, FuncTorchBatched, m) {
17 OP_DECOMPOSE2(_unsafe_index, Tensor);
18 OP_DECOMPOSE(_unsafe_masked_index);
19 OP_DECOMPOSE(_unsafe_index_put);
20 OP_DECOMPOSE(_unsafe_masked_index_put_accumulate);
21 }
22
23 }}
24