2 * Copyright (c) 2023 Samsung Electronics Co., Ltd. All Rights Reserved
3 * Copyright 2015 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.
20 #include <flatbuffers/flexbuffers.h>
22 flatbuffers::Offset<void> ErfChef::value(flatbuffers::FlatBufferBuilder &fbb) const
24 return flatbuffers::Offset<void>();
27 flatbuffers::Offset<flatbuffers::Vector<uint8_t>>
28 ErfChef::custom_value(flatbuffers::FlatBufferBuilder &fbb) const
30 auto &operation = (*_operation);
32 assert(operation.type() == "Erf");
38 .Attr("T: {bfloat16, half, float, double}")
39 .SetShapeFn(shape_inference::UnchangedShape)
42 auto flex_buffers = std::make_unique<flexbuffers::Builder>();
43 size_t map_start = flex_buffers->StartMap();
45 // TODO Support more data types
46 flex_buffers->Int("T", tflite::TensorType_FLOAT32);
48 flex_buffers->EndMap(map_start);
49 flex_buffers->Finish();
51 auto circle_custom_options = fbb.CreateVector(flex_buffers->GetBuffer());
52 return circle_custom_options;
55 std::unique_ptr<OpChef> ErfChefFactory::create(const tflchef::Operation *operation) const
57 return std::unique_ptr<OpChef>{new ErfChef{operation}};