ONE - On-device Neural Engine
Loading...
Searching...
No Matches
GatherND.cpp
Go to the documentation of this file.
1/*
2 * Copyright (c) 2024 Samsung Electronics Co., Ltd. All Rights Reserved
3 * Copyright 2021 The TensorFlow Authors. All Rights Reserved.
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18#include "OMStatus.h"
19
20#include "core/OMUtils.h"
21#include "core/OMKernelData.h"
22
24#include "execute/OMUtils.h"
27#include "PALGatherND.h"
28
29using namespace onert_micro;
30using namespace onert_micro::core;
31using namespace onert_micro::execute;
32
33// NOTE: doesn't currently support dynamic shapes
34OMStatus onert_micro::execute::execute_kernel_CircleGatherND(const OMExecuteArgs &execute_args)
35{
36
37 uint8_t *input_data;
38 uint8_t *position_data;
39 uint8_t *output_data;
40
41 core::OMRuntimeShape input_shape;
42 core::OMRuntimeShape position_shape;
44
45 circle::TensorType inputType;
46
47 OMStatus status =
48 execute::readKernelDataTISO(execute_args, input_data, position_data, output_data, input_shape,
49 position_shape, output_shape, inputType);
50
51 switch (inputType)
52 {
53#ifndef DIS_FLOAT
54 case circle::TensorType_FLOAT32:
55 {
56 pal::GatherND<float, int32_t>(input_shape, utils::castInputData<float>(input_data),
57 position_shape, utils::castInputData<int32_t>(position_data),
58 utils::castOutputData<float>(output_data));
59 }
60 break;
61#endif // DIS_FLOAT
62 default:
63 {
64 status = UnsupportedActivation;
65 assert(false && "Unsupported type.");
66 }
67 }
68
69 return status;
70}
const luci_interpreter::RuntimeShape output_shape
list input_data
Definition infer.py:29
OMStatus readKernelDataTISO(const OMExecuteArgs &execute_args, uint8_t *&input_data1, uint8_t *&input_data2, uint8_t *&output_data, core::OMRuntimeShape &input1_shape_ref, core::OMRuntimeShape &input2_shape_ref, core::OMRuntimeShape &output_shape_ref, circle::TensorType &tensor_type)
@ UnsupportedActivation
Definition OMStatus.h:28