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 "StatelessRandomUniformLayer.h"
19 #include <cker/operation/StatelessRandomUniform.h>
30 StatelessRandomUniformLayer::StatelessRandomUniformLayer()
31 : _shape(nullptr), _seed(nullptr), _output(nullptr)
36 void StatelessRandomUniformLayer::configure(const IPortableTensor *shape,
37 const IPortableTensor *seed, IPortableTensor *output)
44 void StatelessRandomUniformLayer::StatelessRandomUniformFloat32()
46 nnfw::cker::StatelessRandomUniform(getShape(_shape), getBuffer<int32_t>(_shape), getShape(_seed),
47 getBuffer<int32_t>(_seed), getShape(_output),
48 getBuffer<float>(_output));
51 void StatelessRandomUniformLayer::run()
53 switch (_output->data_type())
55 // ToDo : It need to support INT8 and UINT8 also when will be applied quantization.
56 case OperandType::FLOAT32:
57 StatelessRandomUniformFloat32();
60 throw std::runtime_error{"StatelessRandomUniformLayer: unsupported data type"};
66 } // namespace backend