ONE - On-device Neural Engine
Loading...
Searching...
No Matches
Squeeze.cc
Go to the documentation of this file.
1/*
2 * Copyright (c) 2025 Samsung Electronics Co., Ltd. All Rights Reserved
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#include "../KernelGenerator.h"
18#include "../Validator.h"
19
20#include <AclKernelGen.h>
21
23{
24
25void Validator::visit(const ir::operation::Squeeze &) { _supported = true; }
26
27void KernelGenerator::visit(const ir::operation::Squeeze &node)
28{
29 // Squeeze is identical to reshape except that it has an optional dimensions input.
30 // In addition, optional dims_index is ignored since output tensor already has squeezed shape
31 // by freezer and toco
32 const auto output_index{node.getOutputs().at(0)};
33 const auto input_index{node.getInputs().at(ir::operation::Squeeze::Input::INPUT)};
34 const auto dims{node.param().dims};
35 const auto ndim{node.param().ndim};
36 (void)dims;
37 (void)ndim;
38
39 auto output_tensor = _tensor_reg->getAclTensor(output_index);
40 auto input_tensor = _tensor_reg->getAclTensor(input_index);
41 auto fn = acl_common::generateLayer<arm_compute::NEReshapeLayer>(input_tensor->handle(),
42 output_tensor->handle());
44}
45
46} // namespace onert::backend::acl_neon
std::unique_ptr< exec::IFunction > _return_fn
std::vector< int > dims(const std::string &src)
Definition Utils.h:35
std::unique_ptr< AclFunction > asAclFunction(std::unique_ptr<::arm_compute::IFunction > &&layer)
Definition Convert.cc:246