2 * Copyright (c) 2020 Samsung Electronics Co., Ltd. All Rights Reserved
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 #include "TileLayer.h"
19 #include "OperationUtils.h"
21 #include <cker/operation/Tile.h>
32 TileLayer::TileLayer() : _input(nullptr), _multipliers(nullptr), _output(nullptr)
37 void TileLayer::tileFloat32()
39 TileOneDimension(getTensorShape(_input), reinterpret_cast<const float *>(_input->buffer()),
40 reinterpret_cast<const int *>(_multipliers->buffer()),
41 reinterpret_cast<float *>(_output->buffer()), 0);
44 void TileLayer::tileQuant8()
46 // cker quant8 tile is not implemented yet
47 throw std::runtime_error{"NYI"};
50 void TileLayer::configure(const IPortableTensor *input, const IPortableTensor *multipliers,
51 IPortableTensor *output)
54 _multipliers = multipliers;
60 if (_input->data_type() == OperandType::FLOAT32)
64 else if (_input->data_type() == OperandType::QUANT_UINT8_ASYMM)
70 throw std::runtime_error{"Tile: unsupported data type"};
76 } // namespace backend