xref: /aosp_15_r20/external/executorch/kernels/portable/cpu/op_ne.cpp (revision 523fa7a60841cd1ecfb9cc4201f1ca8b03ed023a)
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/kernels/portable/cpu/pattern/comparison_op.h>
10 
11 namespace torch {
12 namespace executor {
13 namespace native {
14 
ne_tensor_out(KernelRuntimeContext & ctx,const Tensor & a,const Tensor & b,Tensor & out)15 Tensor& ne_tensor_out(
16     KernelRuntimeContext& ctx,
17     const Tensor& a,
18     const Tensor& b,
19     Tensor& out) {
20   // @lint-ignore CLANGTIDY facebook-hte-CArray
21   static constexpr const char op_name[] = "ne.Tensor_out";
22   return internal::comparison_tensor_out<op_name>(ctx, a, b, out);
23 }
24 
ne_scalar_out(KernelRuntimeContext & ctx,const Tensor & a,const Scalar & b,Tensor & out)25 Tensor& ne_scalar_out(
26     KernelRuntimeContext& ctx,
27     const Tensor& a,
28     const Scalar& b,
29     Tensor& out) {
30   // @lint-ignore CLANGTIDY facebook-hte-CArray
31   static constexpr const char op_name[] = "ne.Scalar_out";
32   return internal::comparison_scalar_out<op_name>(ctx, a, b, out);
33 }
34 
35 } // namespace native
36 } // namespace executor
37 } // namespace torch
38