2 * Copyright (c) 2020 Samsung Electronics Co., Ltd. All Rights Reserved
3 * Copyright 2017 The TensorFlow Authors. All Rights Reserved.
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
9 * http://www.apache.org/licenses/LICENSE-2.0
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.
23 namespace luci_interpreter
26 void configure_kernel_CircleReshape(const circle::Operator *cur_op, BaseRuntimeGraph *runtime_graph)
31 void execute_kernel_CircleReshape(const circle::Operator *cur_op, BaseRuntimeGraph *runtime_graph,
34 const auto input_index = cur_op->inputs()->operator[](0);
35 const auto output_index = cur_op->outputs()->operator[](0);
37 assert(input_index != -1);
38 assert(output_index != -1);
40 const auto input = runtime_graph->getCircleTensorByIndex(input_index);
41 const auto output = runtime_graph->getCircleTensorByIndex(output_index);
45 runtime_graph->makeInplaceOperation(input, output);
49 const auto input_data = (runtime_graph->getDataByTensor(input));
50 auto output_data = (runtime_graph->getDataByTensor(output));
52 assert(input_data != nullptr);
53 assert(output_data != nullptr);
55 const size_t element_size = getDataTypeSize(Tensor::element_type(input));
56 const int32_t num_elements = Tensor::num_elements(input);
57 std::memcpy(output_data, input_data, num_elements * element_size);
60 } // namespace luci_interpreter