提交 3c717a97 编写于 作者: M mindspore-ci-bot 提交者: Gitee

!3923 add parser

Merge pull request !3923 from 徐安越/master
......@@ -187,7 +187,9 @@ union PrimitiveType {
DivGrad,
PowerGrad,
ActivationGrad,
PriorBox
PriorBox,
SpaceToBatchND,
TopKV2
}
enum QuantType: int {
......
......@@ -677,12 +677,16 @@ table SpaceToBatch {
}
table SparseToDense {
outputShape: [int];
sparseValue: [int];
defaultValue: [int];
validateIndices: bool;
}
table ReverseSequence {
seqAxis: int;
batchAxis: int;
seqLengths: [int];
}
table Rank {
......@@ -781,6 +785,7 @@ table ScatterND {
}
table Unique {
outType: int;
}
table Unstack {
......@@ -820,6 +825,7 @@ table OptMomentum {
table Where{
condition: [bool];
}
table OneHot {
......@@ -829,7 +835,7 @@ table OneHot {
table Lstm{
bidirection: bool = false;
}
table PriorBox {
min_sizes: [int];
max_sizes: [int];
......@@ -843,3 +849,14 @@ table PriorBox {
flip: bool = true;
offset: float;
}
table SpaceToBatchND {
blockShape : [int];
paddings : [int];
}
table TopKV2 {
k : [int];
sorted : bool = true;
}
......@@ -14,7 +14,7 @@
* limitations under the License.
*/
#include "mindspore/lite/tools/converter/parser/tflite/tflite_add_parser.h"
#include "tools/converter/parser/tflite/tflite_add_parser.h"
#include <vector>
#include <memory>
......
......@@ -19,8 +19,8 @@
#include <memory>
#include <vector>
#include "mindspore/lite/tools/converter/parser/tflite/tflite_node_parser.h"
#include "mindspore/lite/tools/converter/parser/tflite/tflite_node_parser_registry.h"
#include "tools/converter/parser/tflite/tflite_node_parser.h"
#include "tools/converter/parser/tflite/tflite_node_parser_registry.h"
namespace mindspore {
namespace lite {
......
/**
* Copyright 2020 Huawei Technologies Co., Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* distributed under the License is distributed on an AS
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <vector>
#include <memory>
#include "tools/converter/parser/tflite/tflite_addn_parser.h"
namespace mindspore {
namespace lite {
STATUS TfliteAddNParser::Parse(const std::unique_ptr<tflite::OperatorT> &tflite_op,
const std::vector<std::unique_ptr<tflite::TensorT>> &tflite_tensors,
const std::vector<std::unique_ptr<tflite::BufferT>> &tflite_model_buffer,
const std::vector<std::unique_ptr<tflite::OperatorCodeT>> &tflite_opset,
schema::CNodeT *op,
TensorCache *tensor_cache,
bool quantized_model) {
MS_LOG(DEBUG) << "parse TfliteAddNParser";
std::unique_ptr<schema::AddNT> attr(new schema::AddNT());
attr->N = tflite_tensors.size();
if (op != nullptr) {
op->primitive = std::make_unique<schema::PrimitiveT>();
op->primitive->value.type = schema::PrimitiveType_AddN;
op->primitive->value.value = attr.release();
}
return RET_OK;
}
TfliteNodeRegister g_tfliteAddNParser("AddN", new TfliteAddNParser());
} // namespace lite
} // namespace mindspore
/**
* Copyright 2020 Huawei Technologies Co., Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef LITE_TFLITE_ADDN_PARSER_H
#define LITE_TFLITE_ADDN_PARSER_H
#include <memory>
#include <vector>
#include "tools/converter/parser/tflite/tflite_node_parser.h"
#include "tools/converter/parser/tflite/tflite_node_parser_registry.h"
namespace mindspore {
namespace lite {
class TfliteAddNParser : public TfliteNodeParser {
public:
TfliteAddNParser() : TfliteNodeParser("AddN") {}
STATUS Parse(const std::unique_ptr<tflite::OperatorT> &tflite_op,
const std::vector<std::unique_ptr<tflite::TensorT>> &tflite_tensors,
const std::vector<std::unique_ptr<tflite::BufferT>> &tflite_model_buffer,
const std::vector<std::unique_ptr<tflite::OperatorCodeT>> &tflite_opset, schema::CNodeT *op,
TensorCache *tensor_cache,
bool quantized_model) override;
};
} // namespace lite
} // namespace mindspore
#endif // LITE_TFLITE_ADDN_PARSER_H
......@@ -14,7 +14,7 @@
* limitations under the License.
*/
#include "mindspore/lite/tools/converter/parser/tflite/tflite_argmax_parser.h"
#include "tools/converter/parser/tflite/tflite_argmax_parser.h"
#include <memory>
#include <vector>
......
......@@ -19,8 +19,8 @@
#include <vector>
#include <memory>
#include "mindspore/lite/tools/converter/parser/tflite/tflite_node_parser.h"
#include "mindspore/lite/tools/converter/parser/tflite/tflite_node_parser_registry.h"
#include "tools/converter/parser/tflite/tflite_node_parser.h"
#include "tools/converter/parser/tflite/tflite_node_parser_registry.h"
namespace mindspore {
namespace lite {
......
......@@ -14,7 +14,7 @@
* limitations under the License.
*/
#include "mindspore/lite/tools/converter/parser/tflite/tflite_argmin_parser.h"
#include "tools/converter/parser/tflite/tflite_argmin_parser.h"
#include <memory>
#include <vector>
......
......@@ -19,8 +19,8 @@
#include <vector>
#include <memory>
#include "mindspore/lite/tools/converter/parser/tflite/tflite_node_parser.h"
#include "mindspore/lite/tools/converter/parser/tflite/tflite_node_parser_registry.h"
#include "tools/converter/parser/tflite/tflite_node_parser.h"
#include "tools/converter/parser/tflite/tflite_node_parser_registry.h"
namespace mindspore {
namespace lite {
......
/**
* Copyright 2020 Huawei Technologies Co., Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* distributed under the License is distributed on an AS
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <vector>
#include <memory>
#include "tools/converter/parser/tflite/tflite_batch_to_space_parser.h"
namespace mindspore {
namespace lite {
STATUS TfliteBatchToSpaceParser::Parse(const std::unique_ptr<tflite::OperatorT> &tflite_op,
const std::vector<std::unique_ptr<tflite::TensorT>> &tflite_tensors,
const std::vector<std::unique_ptr<tflite::BufferT>> &tflite_model_buffer,
const std::vector<std::unique_ptr<tflite::OperatorCodeT>> &tflite_opset,
schema::CNodeT *op,
TensorCache *tensor_cache, bool quantized_model) {
MS_LOG(DEBUG) << "parse TfliteBatchToSpaceParser";
std::unique_ptr<schema::BatchToSpaceT> attr(new schema::BatchToSpaceT());
if (GetTfliteData(tflite_op->inputs[1], tflite_tensors, tflite_model_buffer, attr->blockShape)) {
MS_LOG(ERROR) << "batchToSpace -> blockShape get failed";
return RET_ERROR;
}
if (GetTfliteData(tflite_op->inputs[2], tflite_tensors, tflite_model_buffer, attr->crops)) {
MS_LOG(ERROR) << "batchToSpace -> crops get failed";
return RET_ERROR;
}
if (op != nullptr) {
op->primitive = std::make_unique<schema::PrimitiveT>();
op->primitive->value.type = schema::PrimitiveType_BatchToSpace;
op->primitive->value.value = attr.release();
}
return RET_OK;
}
TfliteNodeRegister g_tfliteBatchToSpaceParser("BatchToSpace", new TfliteBatchToSpaceParser());
} // namespace lite
} // namespace mindspore
/**
* Copyright 2020 Huawei Technologies Co., Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef LITE_TFLITE_BATCH_TO_SPACE_PARSER_H
#define LITE_TFLITE_BATCH_TO_SPACE_PARSER_H
#include <memory>
#include <vector>
#include "tools/converter/parser/tflite/tflite_node_parser.h"
#include "tools/converter/parser/tflite/tflite_node_parser_registry.h"
namespace mindspore {
namespace lite {
class TfliteBatchToSpaceParser : public TfliteNodeParser {
public:
TfliteBatchToSpaceParser() : TfliteNodeParser("BatchToSpace") {}
STATUS Parse(const std::unique_ptr<tflite::OperatorT> &tflite_op,
const std::vector<std::unique_ptr<tflite::TensorT>> &tflite_tensors,
const std::vector<std::unique_ptr<tflite::BufferT>> &tflite_model_buffer,
const std::vector<std::unique_ptr<tflite::OperatorCodeT>> &tflite_opset, schema::CNodeT *op,
TensorCache *tensor_cache,
bool quantized_model) override;
};
} // namespace lite
} // namespace mindspore
#endif // LITE_TFLITE_BATCH_TO_SPACE_PARSER_H
/**
* Copyright 2020 Huawei Technologies Co., Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* distributed under the License is distributed on an AS
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <vector>
#include <memory>
#include "tools/converter/parser/tflite/tflite_broadcast_to_parser.h"
namespace mindspore {
namespace lite {
STATUS TfliteBroadcastToParser::Parse(const std::unique_ptr<tflite::OperatorT> &tflite_op,
const std::vector<std::unique_ptr<tflite::TensorT>> &tflite_tensors,
const std::vector<std::unique_ptr<tflite::BufferT>> &tflite_model_buffer,
const std::vector<std::unique_ptr<tflite::OperatorCodeT>> &tflite_opset,
schema::CNodeT *op,
TensorCache *tensor_cache, bool quantized_model) {
MS_LOG(DEBUG) << "parse TfliteBroadcastToParser";
std::unique_ptr<schema::BroadcastToT> attr(new schema::BroadcastToT());
if (GetTfliteData(tflite_op->inputs[1], tflite_tensors, tflite_model_buffer, attr->dst_shape)) {
MS_LOG(ERROR) << "broadCastTo -> dst_shape get failed";
return RET_ERROR;
}
if (op != nullptr) {
op->primitive = std::make_unique<schema::PrimitiveT>();
op->primitive->value.type = schema::PrimitiveType_BroadcastTo;
op->primitive->value.value = attr.release();
}
return RET_OK;
}
TfliteNodeRegister g_tfliteBroadcastToParser("BroadcastTo", new TfliteBroadcastToParser());
} // namespace lite
} // namespace mindspore
/**
* Copyright 2020 Huawei Technologies Co., Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef LITE_TFLITE_BROADCAST_TO_PARSER_H
#define LITE_TFLITE_BROADCAST_TO_PARSER_H
#include <memory>
#include <vector>
#include "tools/converter/parser/tflite/tflite_node_parser.h"
#include "tools/converter/parser/tflite/tflite_node_parser_registry.h"
namespace mindspore {
namespace lite {
class TfliteBroadcastToParser : public TfliteNodeParser {
public:
TfliteBroadcastToParser() : TfliteNodeParser("BroadcastTo") {}
STATUS Parse(const std::unique_ptr<tflite::OperatorT> &tflite_op,
const std::vector<std::unique_ptr<tflite::TensorT>> &tflite_tensors,
const std::vector<std::unique_ptr<tflite::BufferT>> &tflite_model_buffer,
const std::vector<std::unique_ptr<tflite::OperatorCodeT>> &tflite_opset, schema::CNodeT *op,
TensorCache *tensor_cache,
bool quantized_model) override;
};
} // namespace lite
} // namespace mindspore
#endif // LITE_TFLITE_BROADCAST_TO_PARSER_H
/**
* Copyright 2020 Huawei Technologies Co., Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* distributed under the License is distributed on an AS
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <vector>
#include <memory>
#include "tools/converter/parser/tflite/tflite_cast_parser.h"
namespace mindspore {
namespace lite {
STATUS TfliteCastParser::Parse(const std::unique_ptr<tflite::OperatorT> &tflite_op,
const std::vector<std::unique_ptr<tflite::TensorT>> &tflite_tensors,
const std::vector<std::unique_ptr<tflite::BufferT>> &tflite_model_buffer,
const std::vector<std::unique_ptr<tflite::OperatorCodeT>> &tflite_opset,
schema::CNodeT *op,
TensorCache *tensor_cache, bool quantized_model) {
MS_LOG(DEBUG) << "parse TfliteCastParser";
std::unique_ptr<schema::CastT> attr(new schema::CastT());
const auto &tflite_attr = tflite_op->builtin_options.AsCastOptions();
if (tflite_attr == nullptr) {
MS_LOG(ERROR) << "get op:" << op->name.c_str() << " attr failed";
return RET_NULL_PTR;
}
attr->srcT = tflite_attr->in_data_type;
attr->dstT = tflite_attr->out_data_type;
if (op != nullptr) {
op->primitive = std::make_unique<schema::PrimitiveT>();
op->primitive->value.type = schema::PrimitiveType_Cast;
op->primitive->value.value = attr.release();
}
return RET_OK;
}
TfliteNodeRegister g_tfliteCastParser("Cast", new TfliteCastParser());
} // namespace lite
} // namespace mindspore
/**
* Copyright 2020 Huawei Technologies Co., Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef LITE_TFLITE_CAST_PARSER_H
#define LITE_TFLITE_CAST_PARSER_H
#include <memory>
#include <vector>
#include "tools/converter/parser/tflite/tflite_node_parser.h"
#include "tools/converter/parser/tflite/tflite_node_parser_registry.h"
namespace mindspore {
namespace lite {
class TfliteCastParser : public TfliteNodeParser {
public:
TfliteCastParser() : TfliteNodeParser("Cast") {}
STATUS Parse(const std::unique_ptr<tflite::OperatorT> &tflite_op,
const std::vector<std::unique_ptr<tflite::TensorT>> &tflite_tensors,
const std::vector<std::unique_ptr<tflite::BufferT>> &tflite_model_buffer,
const std::vector<std::unique_ptr<tflite::OperatorCodeT>> &tflite_opset, schema::CNodeT *op,
TensorCache *tensor_cache,
bool quantized_model) override;
};
} // namespace lite
} // namespace mindspore
#endif // LITE_TFLITE_CAST_PARSER_H
......@@ -16,7 +16,7 @@
#include <vector>
#include <memory>
#include "mindspore/lite/tools/converter/parser/tflite/tflite_ceil_parser.h"
#include "tools/converter/parser/tflite/tflite_ceil_parser.h"
namespace mindspore {
namespace lite {
......
......@@ -19,8 +19,8 @@
#include <memory>
#include <vector>
#include "mindspore/lite/tools/converter/parser/tflite/tflite_node_parser.h"
#include "mindspore/lite/tools/converter/parser/tflite/tflite_node_parser_registry.h"
#include "tools/converter/parser/tflite/tflite_node_parser.h"
#include "tools/converter/parser/tflite/tflite_node_parser_registry.h"
namespace mindspore {
namespace lite {
......
......@@ -16,7 +16,7 @@
#include <vector>
#include <memory>
#include "mindspore/lite/tools/converter/parser/tflite/tflite_concat_parser.h"
#include "tools/converter/parser/tflite/tflite_concat_parser.h"
namespace mindspore {
namespace lite {
......
......@@ -19,8 +19,8 @@
#include <vector>
#include <memory>
#include "mindspore/lite/tools/converter/parser/tflite/tflite_node_parser.h"
#include "mindspore/lite/tools/converter/parser/tflite/tflite_node_parser_registry.h"
#include "tools/converter/parser/tflite/tflite_node_parser.h"
#include "tools/converter/parser/tflite/tflite_node_parser_registry.h"
namespace mindspore {
namespace lite {
......
......@@ -16,7 +16,7 @@
#include <vector>
#include <memory>
#include "mindspore/lite/tools/converter/parser/tflite/tflite_conv_parser.h"
#include "tools/converter/parser/tflite/tflite_conv_parser.h"
namespace mindspore {
namespace lite {
......
......@@ -19,8 +19,8 @@
#include <memory>
#include <vector>
#include "mindspore/lite/tools/converter/parser/tflite/tflite_node_parser.h"
#include "mindspore/lite/tools/converter/parser/tflite/tflite_node_parser_registry.h"
#include "tools/converter/parser/tflite/tflite_node_parser.h"
#include "tools/converter/parser/tflite/tflite_node_parser_registry.h"
namespace mindspore {
namespace lite {
......
......@@ -14,7 +14,7 @@
* limitations under the License.
*/
#include "mindspore/lite/tools/converter/parser/tflite/tflite_converter.h"
#include "tools/converter/parser/tflite/tflite_converter.h"
namespace mindspore {
namespace lite {
......
......@@ -19,9 +19,9 @@
#include <string>
#include <memory>
#include "mindspore/lite/tools/converter/converter.h"
#include "mindspore/lite/tools/converter/parser/tflite/tflite_model_parser.h"
#include "mindspore/lite/tools/converter/graphdef_transform.h"
#include "tools/converter/converter.h"
#include "tools/converter/parser/tflite/tflite_model_parser.h"
#include "tools/converter/graphdef_transform.h"
namespace mindspore {
namespace lite {
......
/**
* Copyright 2020 Huawei Technologies Co., Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* distributed under the License is distributed on an AS
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <vector>
#include <memory>
#include "tools/converter/parser/tflite/tflite_depth_to_space_parser.h"
namespace mindspore {
namespace lite {
STATUS TfliteDepthToSpaceParser::Parse(const std::unique_ptr<tflite::OperatorT> &tflite_op,
const std::vector<std::unique_ptr<tflite::TensorT>> &tflite_tensors,
const std::vector<std::unique_ptr<tflite::BufferT>> &tflite_model_buffer,
const std::vector<std::unique_ptr<tflite::OperatorCodeT>> &tflite_opset,
schema::CNodeT *op,
TensorCache *tensor_cache, bool quantized_model) {
MS_LOG(DEBUG) << "parse TfliteDepthToSpaceParser";
std::unique_ptr<schema::DepthToSpaceT> attr(new schema::DepthToSpaceT());
const auto &tflite_attr = tflite_op->builtin_options.AsDepthToSpaceOptions();
if (tflite_attr == nullptr) {
MS_LOG(ERROR) << "get op: %s attr failed", op->name.c_str();
return RET_NULL_PTR;
}
attr->blockSize = tflite_attr->block_size;
attr->format = schema::Format_NHWC;
if (op != nullptr) {
op->primitive = std::make_unique<schema::PrimitiveT>();
op->primitive->value.type = schema::PrimitiveType_DepthToSpace;
op->primitive->value.value = attr.release();
}
return RET_OK;
}
TfliteNodeRegister g_tfliteDepthToSpaceParser("DepthToSpace", new TfliteDepthToSpaceParser());
} // namespace lite
} // namespace mindspore
/**
* Copyright 2020 Huawei Technologies Co., Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef LITE_TFLITE_DEPTH_TO_SPACE_PARSER_H
#define LITE_TFLITE_DEPTH_TO_SPACE_PARSER_H
#include <memory>
#include <vector>
#include "tools/converter/parser/tflite/tflite_node_parser.h"
#include "tools/converter/parser/tflite/tflite_node_parser_registry.h"
namespace mindspore {
namespace lite {
class TfliteDepthToSpaceParser : public TfliteNodeParser {
public:
TfliteDepthToSpaceParser() : TfliteNodeParser("DepthToSpace") {}
STATUS Parse(const std::unique_ptr<tflite::OperatorT> &tflite_op,
const std::vector<std::unique_ptr<tflite::TensorT>> &tflite_tensors,
const std::vector<std::unique_ptr<tflite::BufferT>> &tflite_model_buffer,
const std::vector<std::unique_ptr<tflite::OperatorCodeT>> &tflite_opset, schema::CNodeT *op,
TensorCache *tensor_cache,
bool quantized_model) override;
};
} // namespace lite
} // namespace mindspore
#endif // LITE_TFLITE_DEPTH_TO_SPACE_PARSER_H
......@@ -16,7 +16,7 @@
#include <vector>
#include <memory>
#include "mindspore/lite/tools/converter/parser/tflite/tflite_depthwise_conv_parser.h"
#include "tools/converter/parser/tflite/tflite_depthwise_conv_parser.h"
#include "tools/common/node_util.h"
namespace mindspore {
......
......@@ -19,8 +19,8 @@
#include <vector>
#include <memory>
#include "mindspore/lite/tools/converter/parser/tflite/tflite_node_parser.h"
#include "mindspore/lite/tools/converter/parser/tflite/tflite_node_parser_registry.h"
#include "tools/converter/parser/tflite/tflite_node_parser.h"
#include "tools/converter/parser/tflite/tflite_node_parser_registry.h"
namespace mindspore {
namespace lite {
......
......@@ -16,7 +16,7 @@
#include <vector>
#include <memory>
#include "mindspore/lite/tools/converter/parser/tflite/tflite_div_parser.h"
#include "tools/converter/parser/tflite/tflite_div_parser.h"
namespace mindspore {
namespace lite {
......
......@@ -19,8 +19,8 @@
#include <memory>
#include <vector>
#include "mindspore/lite/tools/converter/parser/tflite/tflite_node_parser.h"
#include "mindspore/lite/tools/converter/parser/tflite/tflite_node_parser_registry.h"
#include "tools/converter/parser/tflite/tflite_node_parser.h"
#include "tools/converter/parser/tflite/tflite_node_parser_registry.h"
namespace mindspore {
namespace lite {
......
/**
* Copyright 2020 Huawei Technologies Co., Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* distributed under the License is distributed on an AS
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <vector>
#include <memory>
#include "tools/converter/parser/tflite/tflite_equal_parser.h"
namespace mindspore {
namespace lite {
STATUS TfliteEqualParser::Parse(const std::unique_ptr<tflite::OperatorT> &tflite_op,
const std::vector<std::unique_ptr<tflite::TensorT>> &tflite_tensors,
const std::vector<std::unique_ptr<tflite::BufferT>> &tflite_model_buffer,
const std::vector<std::unique_ptr<tflite::OperatorCodeT>> &tflite_opset,
schema::CNodeT *op,
TensorCache *tensor_cache, bool quantized_model) {
MS_LOG(DEBUG) << "parse TfliteEqualParser";
std::unique_ptr<schema::EqualT> attr(new schema::EqualT());
if (op != nullptr) {
op->primitive = std::make_unique<schema::PrimitiveT>();
op->primitive->value.type = schema::PrimitiveType_Equal;
op->primitive->value.value = attr.release();
}
return RET_OK;
}
TfliteNodeRegister g_tfliteEqualParser("Equal", new TfliteEqualParser());
} // namespace lite
} // namespace mindspore
/**
* Copyright 2020 Huawei Technologies Co., Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef LITE_TFLITE_EQUAL_PARSER_H
#define LITE_TFLITE_EQUAL_PARSER_H
#include <memory>
#include <vector>
#include "tools/converter/parser/tflite/tflite_node_parser.h"
#include "tools/converter/parser/tflite/tflite_node_parser_registry.h"
namespace mindspore {
namespace lite {
class TfliteEqualParser : public TfliteNodeParser {
public:
TfliteEqualParser() : TfliteNodeParser("Equal") {}
STATUS Parse(const std::unique_ptr<tflite::OperatorT> &tflite_op,
const std::vector<std::unique_ptr<tflite::TensorT>> &tflite_tensors,
const std::vector<std::unique_ptr<tflite::BufferT>> &tflite_model_buffer,
const std::vector<std::unique_ptr<tflite::OperatorCodeT>> &tflite_opset, schema::CNodeT *op,
TensorCache *tensor_cache,
bool quantized_model) override;
};
} // namespace lite
} // namespace mindspore
#endif // LITE_TFLITE_EQUAL_PARSER_H
......@@ -14,7 +14,7 @@
* limitations under the License.
*/
#include "mindspore/lite/tools/converter/parser/tflite/tflite_expand_dims_parser.h"
#include "tools/converter/parser/tflite/tflite_expand_dims_parser.h"
#include <vector>
#include <memory>
......
......@@ -19,8 +19,8 @@
#include <memory>
#include <vector>
#include "mindspore/lite/tools/converter/parser/tflite/tflite_node_parser.h"
#include "mindspore/lite/tools/converter/parser/tflite/tflite_node_parser_registry.h"
#include "tools/converter/parser/tflite/tflite_node_parser.h"
#include "tools/converter/parser/tflite/tflite_node_parser_registry.h"
namespace mindspore {
namespace lite {
......
......@@ -18,8 +18,8 @@
#include <vector>
#include <memory>
#include "mindspore/lite/tools/converter/parser/tflite/tflite_node_parser.h"
#include "mindspore/lite/tools/converter/parser/tflite/tflite_node_parser_registry.h"
#include "tools/converter/parser/tflite/tflite_node_parser.h"
#include "tools/converter/parser/tflite/tflite_node_parser_registry.h"
namespace mindspore {
namespace lite {
......
......@@ -16,7 +16,7 @@
#include <vector>
#include <memory>
#include "mindspore/lite/tools/converter/parser/tflite/tflite_fill_parser.h"
#include "tools/converter/parser/tflite/tflite_fill_parser.h"
namespace mindspore {
namespace lite {
......
......@@ -19,8 +19,8 @@
#include <memory>
#include <vector>
#include "mindspore/lite/tools/converter/parser/tflite/tflite_node_parser.h"
#include "mindspore/lite/tools/converter/parser/tflite/tflite_node_parser_registry.h"
#include "tools/converter/parser/tflite/tflite_node_parser.h"
#include "tools/converter/parser/tflite/tflite_node_parser_registry.h"
namespace mindspore {
namespace lite {
......
......@@ -14,7 +14,7 @@
* limitations under the License.
*/
#include "mindspore/lite/tools/converter/parser/tflite/tflite_floor_div_parser.h"
#include "tools/converter/parser/tflite/tflite_floor_div_parser.h"
#include <vector>
#include <memory>
......
......@@ -19,8 +19,8 @@
#include <memory>
#include <vector>
#include "mindspore/lite/tools/converter/parser/tflite/tflite_node_parser.h"
#include "mindspore/lite/tools/converter/parser/tflite/tflite_node_parser_registry.h"
#include "tools/converter/parser/tflite/tflite_node_parser.h"
#include "tools/converter/parser/tflite/tflite_node_parser_registry.h"
namespace mindspore {
namespace lite {
......
......@@ -14,7 +14,7 @@
* limitations under the License.
*/
#include "mindspore/lite/tools/converter/parser/tflite/tflite_floor_mod_parser.h"
#include "tools/converter/parser/tflite/tflite_floor_mod_parser.h"
#include <vector>
#include <memory>
......
......@@ -19,8 +19,8 @@
#include <memory>
#include <vector>
#include "mindspore/lite/tools/converter/parser/tflite/tflite_node_parser.h"
#include "mindspore/lite/tools/converter/parser/tflite/tflite_node_parser_registry.h"
#include "tools/converter/parser/tflite/tflite_node_parser.h"
#include "tools/converter/parser/tflite/tflite_node_parser_registry.h"
namespace mindspore {
namespace lite {
......
......@@ -14,7 +14,7 @@
* limitations under the License.
*/
#include "mindspore/lite/tools/converter/parser/tflite/tflite_floor_parser.h"
#include "tools/converter/parser/tflite/tflite_floor_parser.h"
#include <vector>
#include <memory>
......
......@@ -19,8 +19,8 @@
#include <memory>
#include <vector>
#include "mindspore/lite/tools/converter/parser/tflite/tflite_node_parser.h"
#include "mindspore/lite/tools/converter/parser/tflite/tflite_node_parser_registry.h"
#include "tools/converter/parser/tflite/tflite_node_parser.h"
#include "tools/converter/parser/tflite/tflite_node_parser_registry.h"
namespace mindspore {
namespace lite {
......
......@@ -16,7 +16,7 @@
#include <vector>
#include <memory>
#include "mindspore/lite/tools/converter/parser/tflite/tflite_fullyconnected_parser.h"
#include "tools/converter/parser/tflite/tflite_fullyconnected_parser.h"
namespace mindspore {
namespace lite {
......
......@@ -19,8 +19,8 @@
#include <vector>
#include <memory>
#include "mindspore/lite/tools/converter/parser/tflite/tflite_node_parser.h"
#include "mindspore/lite/tools/converter/parser/tflite/tflite_node_parser_registry.h"
#include "tools/converter/parser/tflite/tflite_node_parser.h"
#include "tools/converter/parser/tflite/tflite_node_parser_registry.h"
namespace mindspore {
namespace lite {
......
......@@ -14,7 +14,7 @@
* limitations under the License.
*/
#include "mindspore/lite/tools/converter/parser/tflite/tflite_gather_nd_parser.h"
#include "tools/converter/parser/tflite/tflite_gather_nd_parser.h"
#include <vector>
#include <memory>
......
......@@ -19,8 +19,8 @@
#include <memory>
#include <vector>
#include "mindspore/lite/tools/converter/parser/tflite/tflite_node_parser.h"
#include "mindspore/lite/tools/converter/parser/tflite/tflite_node_parser_registry.h"
#include "tools/converter/parser/tflite/tflite_node_parser.h"
#include "tools/converter/parser/tflite/tflite_node_parser_registry.h"
namespace mindspore {
namespace lite {
......
......@@ -14,7 +14,7 @@
* limitations under the License.
*/
#include "mindspore/lite/tools/converter/parser/tflite/tflite_gather_parser.h"
#include "tools/converter/parser/tflite/tflite_gather_parser.h"
#include <vector>
#include <memory>
......
......@@ -19,8 +19,8 @@
#include <memory>
#include <vector>
#include "mindspore/lite/tools/converter/parser/tflite/tflite_node_parser.h"
#include "mindspore/lite/tools/converter/parser/tflite/tflite_node_parser_registry.h"
#include "tools/converter/parser/tflite/tflite_node_parser.h"
#include "tools/converter/parser/tflite/tflite_node_parser_registry.h"
namespace mindspore {
namespace lite {
......
......@@ -14,7 +14,7 @@
* limitations under the License.
*/
#include "mindspore/lite/tools/converter/parser/tflite/tflite_gather_v2_parser.h"
#include "tools/converter/parser/tflite/tflite_gather_v2_parser.h"
#include <vector>
#include <memory>
......
......@@ -19,8 +19,8 @@
#include <memory>
#include <vector>
#include "mindspore/lite/tools/converter/parser/tflite/tflite_node_parser.h"
#include "mindspore/lite/tools/converter/parser/tflite/tflite_node_parser_registry.h"
#include "tools/converter/parser/tflite/tflite_node_parser.h"
#include "tools/converter/parser/tflite/tflite_node_parser_registry.h"
namespace mindspore {
namespace lite {
......
/**
* Copyright 2020 Huawei Technologies Co., Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* distributed under the License is distributed on an AS
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <vector>
#include <memory>
#include "tools/converter/parser/tflite/tflite_greater_equal_parser.h"
namespace mindspore {
namespace lite {
STATUS TfliteGreaterEqualParser::Parse(const std::unique_ptr<tflite::OperatorT> &tflite_op,
const std::vector<std::unique_ptr<tflite::TensorT>> &tflite_tensors,
const std::vector<std::unique_ptr<tflite::BufferT>> &tflite_model_buffer,
const std::vector<std::unique_ptr<tflite::OperatorCodeT>> &tflite_opset,
schema::CNodeT *op,
TensorCache *tensor_cache, bool quantized_model) {
MS_LOG(DEBUG) << "parse TfliteGreaterEqualParser";
std::unique_ptr<schema::GreaterEqualT> attr(new schema::GreaterEqualT());
if (op != nullptr) {
op->primitive = std::make_unique<schema::PrimitiveT>();
op->primitive->value.type = schema::PrimitiveType_GreaterEqual;
op->primitive->value.value = attr.release();
}
return RET_OK;
}
TfliteNodeRegister g_tfliteGreaterEqualParser("GreaterEqual", new TfliteGreaterEqualParser());
} // namespace lite
} // namespace mindspore
/**
* Copyright 2020 Huawei Technologies Co., Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef LITE_TFLITE_GREATER_EQUAL_PARSER_H
#define LITE_TFLITE_GREATER_EQUAL_PARSER_H
#include <memory>
#include <vector>
#include "tools/converter/parser/tflite/tflite_node_parser.h"
#include "tools/converter/parser/tflite/tflite_node_parser_registry.h"
namespace mindspore {
namespace lite {
class TfliteGreaterEqualParser : public TfliteNodeParser {
public:
TfliteGreaterEqualParser() : TfliteNodeParser("GreaterEqual") {}
STATUS Parse(const std::unique_ptr<tflite::OperatorT> &tflite_op,
const std::vector<std::unique_ptr<tflite::TensorT>> &tflite_tensors,
const std::vector<std::unique_ptr<tflite::BufferT>> &tflite_model_buffer,
const std::vector<std::unique_ptr<tflite::OperatorCodeT>> &tflite_opset, schema::CNodeT *op,
TensorCache *tensor_cache,
bool quantized_model) override;
};
} // namespace lite
} // namespace mindspore
#endif // LITE_TFLITE_GREATER_EQUAL_PARSER_H
/**
* Copyright 2020 Huawei Technologies Co., Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* distributed under the License is distributed on an AS
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <vector>
#include <memory>
#include "tools/converter/parser/tflite/tflite_greater_parser.h"
namespace mindspore {
namespace lite {
STATUS TfliteGreaterParser::Parse(const std::unique_ptr<tflite::OperatorT> &tflite_op,
const std::vector<std::unique_ptr<tflite::TensorT>> &tflite_tensors,
const std::vector<std::unique_ptr<tflite::BufferT>> &tflite_model_buffer,
const std::vector<std::unique_ptr<tflite::OperatorCodeT>> &tflite_opset,
schema::CNodeT *op,
TensorCache *tensor_cache, bool quantized_model) {
MS_LOG(DEBUG) << "parse TfliteGreaterParser";
std::unique_ptr<schema::GreaterT> attr(new schema::GreaterT());
if (op != nullptr) {
op->primitive = std::make_unique<schema::PrimitiveT>();
op->primitive->value.type = schema::PrimitiveType_Greater;
op->primitive->value.value = attr.release();
}
return RET_OK;
}
TfliteNodeRegister g_tfliteGreaterParser("Greater", new TfliteGreaterParser());
} // namespace lite
} // namespace mindspore
/**
* Copyright 2020 Huawei Technologies Co., Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef LITE_TFLITE_GREATER_PARSER_H
#define LITE_TFLITE_GREATER_PARSER_H
#include <memory>
#include <vector>
#include "tools/converter/parser/tflite/tflite_node_parser.h"
#include "tools/converter/parser/tflite/tflite_node_parser_registry.h"
namespace mindspore {
namespace lite {
class TfliteGreaterParser : public TfliteNodeParser {
public:
TfliteGreaterParser() : TfliteNodeParser("Greater") {}
STATUS Parse(const std::unique_ptr<tflite::OperatorT> &tflite_op,
const std::vector<std::unique_ptr<tflite::TensorT>> &tflite_tensors,
const std::vector<std::unique_ptr<tflite::BufferT>> &tflite_model_buffer,
const std::vector<std::unique_ptr<tflite::OperatorCodeT>> &tflite_opset, schema::CNodeT *op,
TensorCache *tensor_cache,
bool quantized_model) override;
};
} // namespace lite
} // namespace mindspore
#endif // LITE_TFLITE_GREATER_PARSER_H
......@@ -14,7 +14,7 @@
* limitations under the License.
*/
#include "mindspore/lite/tools/converter/parser/tflite/tflite_inner_product_parser.h"
#include "tools/converter/parser/tflite/tflite_inner_product_parser.h"
#include <vector>
#include <memory>
......
......@@ -19,8 +19,8 @@
#include <memory>
#include <vector>
#include "mindspore/lite/tools/converter/parser/tflite/tflite_node_parser.h"
#include "mindspore/lite/tools/converter/parser/tflite/tflite_node_parser_registry.h"
#include "tools/converter/parser/tflite/tflite_node_parser.h"
#include "tools/converter/parser/tflite/tflite_node_parser_registry.h"
namespace mindspore {
namespace lite {
......
......@@ -16,7 +16,7 @@
#include <memory>
#include <vector>
#include "mindspore/lite/tools/converter/parser/tflite/tflite_leaky_relu_parser.h"
#include "tools/converter/parser/tflite/tflite_leaky_relu_parser.h"
namespace mindspore {
namespace lite {
......
......@@ -17,8 +17,8 @@
#ifndef PREDICT_TFLITE_LEAKY_RELU_PARSER_H
#define PREDICT_TFLITE_LEAKY_RELU_PARSER_H
#include "mindspore/lite/tools/converter/parser/tflite/tflite_node_parser.h"
#include "mindspore/lite/tools/converter/parser/tflite/tflite_node_parser_registry.h"
#include "tools/converter/parser/tflite/tflite_node_parser.h"
#include "tools/converter/parser/tflite/tflite_node_parser_registry.h"
#include <vector>
#include <memory>
......
/**
* Copyright 2020 Huawei Technologies Co., Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* distributed under the License is distributed on an AS
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <vector>
#include <memory>
#include "tools/converter/parser/tflite/tflite_less_equal_parser.h"
namespace mindspore {
namespace lite {
STATUS TfliteLessEqualParser::Parse(const std::unique_ptr<tflite::OperatorT> &tflite_op,
const std::vector<std::unique_ptr<tflite::TensorT>> &tflite_tensors,
const std::vector<std::unique_ptr<tflite::BufferT>> &tflite_model_buffer,
const std::vector<std::unique_ptr<tflite::OperatorCodeT>> &tflite_opset,
schema::CNodeT *op,
TensorCache *tensor_cache, bool quantized_model) {
MS_LOG(DEBUG) << "parse TfliteLessEqualParser";
std::unique_ptr<schema::LessEqualT> attr(new schema::LessEqualT());
if (op != nullptr) {
op->primitive = std::make_unique<schema::PrimitiveT>();
op->primitive->value.type = schema::PrimitiveType_LessEqual;
op->primitive->value.value = attr.release();
}
return RET_OK;
}
TfliteNodeRegister g_tfliteLessEqualParser("LessEqual", new TfliteLessEqualParser());
} // namespace lite
} // namespace mindspore
/**
* Copyright 2020 Huawei Technologies Co., Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef LITE_TFLITE_LESS_EQUAL_PARSER_H
#define LITE_TFLITE_LESS_EQUAL_PARSER_H
#include <memory>
#include <vector>
#include "tools/converter/parser/tflite/tflite_node_parser.h"
#include "tools/converter/parser/tflite/tflite_node_parser_registry.h"
namespace mindspore {
namespace lite {
class TfliteLessEqualParser : public TfliteNodeParser {
public:
TfliteLessEqualParser() : TfliteNodeParser("LessEqual") {}
STATUS Parse(const std::unique_ptr<tflite::OperatorT> &tflite_op,
const std::vector<std::unique_ptr<tflite::TensorT>> &tflite_tensors,
const std::vector<std::unique_ptr<tflite::BufferT>> &tflite_model_buffer,
const std::vector<std::unique_ptr<tflite::OperatorCodeT>> &tflite_opset, schema::CNodeT *op,
TensorCache *tensor_cache,
bool quantized_model) override;
};
} // namespace lite
} // namespace mindspore
#endif // LITE_TFLITE_LESS_EQUAL_PARSER_H
/**
* Copyright 2020 Huawei Technologies Co., Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* distributed under the License is distributed on an AS
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <vector>
#include <memory>
#include "tools/converter/parser/tflite/tflite_less_parser.h"
namespace mindspore {
namespace lite {
STATUS TfliteLessParser::Parse(const std::unique_ptr<tflite::OperatorT> &tflite_op,
const std::vector<std::unique_ptr<tflite::TensorT>> &tflite_tensors,
const std::vector<std::unique_ptr<tflite::BufferT>> &tflite_model_buffer,
const std::vector<std::unique_ptr<tflite::OperatorCodeT>> &tflite_opset,
schema::CNodeT *op,
TensorCache *tensor_cache, bool quantized_model) {
MS_LOG(DEBUG) << "parse TfliteLessParser";
std::unique_ptr<schema::LessT> attr(new schema::LessT());
if (op != nullptr) {
op->primitive = std::make_unique<schema::PrimitiveT>();
op->primitive->value.type = schema::PrimitiveType_Less;
op->primitive->value.value = attr.release();
}
return RET_OK;
}
TfliteNodeRegister g_tfliteLessParser("Less", new TfliteLessParser());
} // namespace lite
} // namespace mindspore
/**
* Copyright 2020 Huawei Technologies Co., Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef LITE_TFLITE_LESS_PARSER_H
#define LITE_TFLITE_LESS_PARSER_H
#include <memory>
#include <vector>
#include "tools/converter/parser/tflite/tflite_node_parser.h"
#include "tools/converter/parser/tflite/tflite_node_parser_registry.h"
namespace mindspore {
namespace lite {
class TfliteLessParser : public TfliteNodeParser {
public:
TfliteLessParser() : TfliteNodeParser("Less") {}
STATUS Parse(const std::unique_ptr<tflite::OperatorT> &tflite_op,
const std::vector<std::unique_ptr<tflite::TensorT>> &tflite_tensors,
const std::vector<std::unique_ptr<tflite::BufferT>> &tflite_model_buffer,
const std::vector<std::unique_ptr<tflite::OperatorCodeT>> &tflite_opset, schema::CNodeT *op,
TensorCache *tensor_cache,
bool quantized_model) override;
};
} // namespace lite
} // namespace mindspore
#endif // LITE_TFLITE_LESS_PARSER_H
......@@ -16,7 +16,7 @@
#include <vector>
#include <memory>
#include "mindspore/lite/tools/converter/parser/tflite/tflite_logistic_parser.h"
#include "tools/converter/parser/tflite/tflite_logistic_parser.h"
namespace mindspore {
namespace lite {
......
......@@ -19,8 +19,8 @@
#include <memory>
#include <vector>
#include "mindspore/lite/tools/converter/parser/tflite/tflite_node_parser.h"
#include "mindspore/lite/tools/converter/parser/tflite/tflite_node_parser_registry.h"
#include "tools/converter/parser/tflite/tflite_node_parser.h"
#include "tools/converter/parser/tflite/tflite_node_parser_registry.h"
namespace mindspore {
namespace lite {
......
......@@ -14,7 +14,7 @@
* limitations under the License.
*/
#include "mindspore/lite/tools/converter/parser/tflite/tflite_lrn_parser.h"
#include "tools/converter/parser/tflite/tflite_lrn_parser.h"
#include <vector>
#include <memory>
......
......@@ -19,8 +19,8 @@
#include <memory>
#include <vector>
#include "mindspore/lite/tools/converter/parser/tflite/tflite_node_parser.h"
#include "mindspore/lite/tools/converter/parser/tflite/tflite_node_parser_registry.h"
#include "tools/converter/parser/tflite/tflite_node_parser.h"
#include "tools/converter/parser/tflite/tflite_node_parser_registry.h"
namespace mindspore {
namespace lite {
......
......@@ -16,7 +16,7 @@
#include <vector>
#include <memory>
#include "mindspore/lite/tools/converter/parser/tflite/tflite_max_pooling_parser.h"
#include "tools/converter/parser/tflite/tflite_max_pooling_parser.h"
namespace mindspore {
namespace lite {
......
......@@ -19,8 +19,8 @@
#include <vector>
#include <memory>
#include "mindspore/lite/tools/converter/parser/tflite/tflite_node_parser.h"
#include "mindspore/lite/tools/converter/parser/tflite/tflite_node_parser_registry.h"
#include "tools/converter/parser/tflite/tflite_node_parser.h"
#include "tools/converter/parser/tflite/tflite_node_parser_registry.h"
namespace mindspore {
namespace lite {
......
......@@ -16,7 +16,7 @@
#include <vector>
#include <memory>
#include "mindspore/lite/tools/converter/parser/tflite/tflite_mean_pooling_parser.h"
#include "tools/converter/parser/tflite/tflite_mean_pooling_parser.h"
namespace mindspore {
namespace lite {
......
......@@ -19,8 +19,8 @@
#include <vector>
#include <memory>
#include "mindspore/lite/tools/converter/parser/tflite/tflite_node_parser.h"
#include "mindspore/lite/tools/converter/parser/tflite/tflite_node_parser_registry.h"
#include "tools/converter/parser/tflite/tflite_node_parser.h"
#include "tools/converter/parser/tflite/tflite_node_parser_registry.h"
namespace mindspore {
namespace lite {
......
......@@ -14,7 +14,7 @@
* limitations under the License.
*/
#include "mindspore/lite/tools/converter/parser/tflite/tflite_model_parser.h"
#include "tools/converter/parser/tflite/tflite_model_parser.h"
#include <fstream>
#include <utility>
#include <memory>
......
......@@ -29,8 +29,8 @@
#include <map>
#include "securec/include/securec.h"
#include "mindspore/lite/tools/converter/model_parser.h"
#include "mindspore/lite/tools/converter/parser/tflite/tflite_node_parser_registry.h"
#include "tools/converter/model_parser.h"
#include "tools/converter/parser/tflite/tflite_node_parser_registry.h"
#include "tools/common/tensor_util.h"
#include "mindspore/lite/schema/inner/model_generated.h"
......
......@@ -16,7 +16,7 @@
#include <vector>
#include <memory>
#include "mindspore/lite/tools/converter/parser/tflite/tflite_mul_parser.h"
#include "tools/converter/parser/tflite/tflite_mul_parser.h"
namespace mindspore {
namespace lite {
......
......@@ -19,8 +19,8 @@
#include <memory>
#include <vector>
#include "mindspore/lite/tools/converter/parser/tflite/tflite_node_parser.h"
#include "mindspore/lite/tools/converter/parser/tflite/tflite_node_parser_registry.h"
#include "tools/converter/parser/tflite/tflite_node_parser.h"
#include "tools/converter/parser/tflite/tflite_node_parser_registry.h"
namespace mindspore {
namespace lite {
......
......@@ -18,7 +18,7 @@
#include <memory>
#include <unordered_map>
#include "securec/include/securec.h"
#include "mindspore/lite/tools/converter/parser/tflite/tflite_node_parser.h"
#include "tools/converter/parser/tflite/tflite_node_parser.h"
namespace mindspore {
namespace lite {
......
......@@ -14,7 +14,7 @@
* limitations under the License.
*/
#include "mindspore/lite/tools/converter/parser/tflite/tflite_node_parser_registry.h"
#include "tools/converter/parser/tflite/tflite_node_parser_registry.h"
namespace mindspore {
namespace lite {
......
......@@ -20,7 +20,7 @@
#include <string>
#include <unordered_map>
#include "tools/common/node_util.h"
#include "mindspore/lite/tools/converter/parser/tflite/tflite_node_parser.h"
#include "tools/converter/parser/tflite/tflite_node_parser.h"
namespace mindspore {
namespace lite {
......
/**
* Copyright 2020 Huawei Technologies Co., Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* distributed under the License is distributed on an AS
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <vector>
#include <memory>
#include "tools/converter/parser/tflite/tflite_not_equal_parser.h"
namespace mindspore {
namespace lite {
STATUS TfliteNotEqualParser::Parse(const std::unique_ptr<tflite::OperatorT> &tflite_op,
const std::vector<std::unique_ptr<tflite::TensorT>> &tflite_tensors,
const std::vector<std::unique_ptr<tflite::BufferT>> &tflite_model_buffer,
const std::vector<std::unique_ptr<tflite::OperatorCodeT>> &tflite_opset,
schema::CNodeT *op,
TensorCache *tensor_cache, bool quantized_model) {
MS_LOG(DEBUG) << "parse TfliteNotEqualParser";
std::unique_ptr<schema::NotEqualT> attr(new schema::NotEqualT());
if (op != nullptr) {
op->primitive = std::make_unique<schema::PrimitiveT>();
op->primitive->value.type = schema::PrimitiveType_NotEqual;
op->primitive->value.value = attr.release();
}
return RET_OK;
}
TfliteNodeRegister g_tfliteNotEqualParser("NotEqual", new TfliteNotEqualParser());
} // namespace lite
} // namespace mindspore
/**
* Copyright 2020 Huawei Technologies Co., Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef LITE_TFLITE_NOT_EQUAL_PARSER_H
#define LITE_TFLITE_NOT_EQUAL_PARSER_H
#include <memory>
#include <vector>
#include "tools/converter/parser/tflite/tflite_node_parser.h"
#include "tools/converter/parser/tflite/tflite_node_parser_registry.h"
namespace mindspore {
namespace lite {
class TfliteNotEqualParser : public TfliteNodeParser {
public:
TfliteNotEqualParser() : TfliteNodeParser("NotEqual") {}
STATUS Parse(const std::unique_ptr<tflite::OperatorT> &tflite_op,
const std::vector<std::unique_ptr<tflite::TensorT>> &tflite_tensors,
const std::vector<std::unique_ptr<tflite::BufferT>> &tflite_model_buffer,
const std::vector<std::unique_ptr<tflite::OperatorCodeT>> &tflite_opset, schema::CNodeT *op,
TensorCache *tensor_cache,
bool quantized_model) override;
};
} // namespace lite
} // namespace mindspore
#endif // LITE_TFLITE_NOT_EQUAL_PARSER_H
/**
* Copyright 2020 Huawei Technologies Co., Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* distributed under the License is distributed on an AS
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <memory>
#include <vector>
#include "tools/converter/parser/tflite/tflite_p_relu_parser.h"
namespace mindspore {
namespace lite {
STATUS TflitePreluParser::Parse(const std::unique_ptr<tflite::OperatorT> &tflite_op,
const std::vector<std::unique_ptr<tflite::TensorT>> &tflite_tensors,
const std::vector<std::unique_ptr<tflite::BufferT>> &tflite_model_buffer,
const std::vector<std::unique_ptr<tflite::OperatorCodeT>> &tflite_opset,
schema::CNodeT *op, TensorCache *tensor_cache, bool quantized_model) {
MS_LOG(DEBUG) << "paser TflitePreluParser";
std::unique_ptr<schema::PreluT> attr(new schema::PreluT());
if (GetTfliteData(tflite_op->inputs[1], tflite_tensors, tflite_model_buffer, attr->slope)) {
MS_LOG(ERROR) << "pRelu -> slope get failed";
return RET_ERROR;
}
if (op != nullptr) {
op->primitive = std::make_unique<schema::PrimitiveT>();
op->primitive->value.type = schema::PrimitiveType_Prelu;
op->primitive->value.value = attr.release();
}
return RET_OK;
}
TfliteNodeRegister g_tflitePreluParser("Prelu", new TflitePreluParser());
} // namespace lite
} // namespace mindspore
/**
* Copyright 2020 Huawei Technologies Co., Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef LITE_TFLITE_P_RELU_PARSER_H
#define LITE_TFLITE_P_RELU_PARSER_H
#include <vector>
#include <memory>
#include "tools/converter/parser/tflite/tflite_node_parser.h"
#include "tools/converter/parser/tflite/tflite_node_parser_registry.h"
namespace mindspore {
namespace lite {
class TflitePreluParser : public TfliteNodeParser {
public:
TflitePreluParser() : TfliteNodeParser("Prelu") {}
STATUS Parse(const std::unique_ptr<tflite::OperatorT> &tflite_op,
const std::vector<std::unique_ptr<tflite::TensorT>> &tflite_tensors,
const std::vector<std::unique_ptr<tflite::BufferT>> &tflite_model_buffer,
const std::vector<std::unique_ptr<tflite::OperatorCodeT>> &tflite_opset, schema::CNodeT *op,
TensorCache *tensor_cache, bool quantized_model) override;
};
} // namespace lite
} // namespace mindspore
#endif // LITE_TFLITE_P_RELU_PARSER_H
......@@ -16,7 +16,7 @@
#include <vector>
#include <memory>
#include "mindspore/lite/tools/converter/parser/tflite/tflite_pad_parser.h"
#include "tools/converter/parser/tflite/tflite_pad_parser.h"
namespace mindspore {
namespace lite {
......
......@@ -19,8 +19,8 @@
#include <memory>
#include <vector>
#include "mindspore/lite/tools/converter/parser/tflite/tflite_node_parser.h"
#include "mindspore/lite/tools/converter/parser/tflite/tflite_node_parser_registry.h"
#include "tools/converter/parser/tflite/tflite_node_parser.h"
#include "tools/converter/parser/tflite/tflite_node_parser_registry.h"
namespace mindspore {
namespace lite {
......
......@@ -16,7 +16,7 @@
#include <vector>
#include <memory>
#include "mindspore/lite/tools/converter/parser/tflite/tflite_pow_parser.h"
#include "tools/converter/parser/tflite/tflite_pow_parser.h"
namespace mindspore {
namespace lite {
......
......@@ -19,8 +19,8 @@
#include <memory>
#include <vector>
#include "mindspore/lite/tools/converter/parser/tflite/tflite_node_parser.h"
#include "mindspore/lite/tools/converter/parser/tflite/tflite_node_parser_registry.h"
#include "tools/converter/parser/tflite/tflite_node_parser.h"
#include "tools/converter/parser/tflite/tflite_node_parser_registry.h"
namespace mindspore {
namespace lite {
......
......@@ -14,7 +14,7 @@
* limitations under the License.
*/
#include "mindspore/lite/tools/converter/parser/tflite/tflite_range_parser.h"
#include "tools/converter/parser/tflite/tflite_range_parser.h"
#include <vector>
#include <memory>
......
......@@ -19,8 +19,8 @@
#include <memory>
#include <vector>
#include "mindspore/lite/tools/converter/parser/tflite/tflite_node_parser.h"
#include "mindspore/lite/tools/converter/parser/tflite/tflite_node_parser_registry.h"
#include "tools/converter/parser/tflite/tflite_node_parser.h"
#include "tools/converter/parser/tflite/tflite_node_parser_registry.h"
namespace mindspore {
namespace lite {
......
......@@ -14,7 +14,7 @@
* limitations under the License.
*/
#include "mindspore/lite/tools/converter/parser/tflite/tflite_rank_parser.h"
#include "tools/converter/parser/tflite/tflite_rank_parser.h"
#include <vector>
#include <memory>
......
......@@ -19,8 +19,8 @@
#include <memory>
#include <vector>
#include "mindspore/lite/tools/converter/parser/tflite/tflite_node_parser.h"
#include "mindspore/lite/tools/converter/parser/tflite/tflite_node_parser_registry.h"
#include "tools/converter/parser/tflite/tflite_node_parser.h"
#include "tools/converter/parser/tflite/tflite_node_parser_registry.h"
namespace mindspore {
namespace lite {
......
/**
* Copyright 2020 Huawei Technologies Co., Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* distributed under the License is distributed on an AS
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <vector>
#include <memory>
#include "tools/converter/parser/tflite/tflite_real_div_parser.h"
namespace mindspore {
namespace lite {
STATUS TfliteRealDivParser::Parse(const std::unique_ptr<tflite::OperatorT> &tflite_op,
const std::vector<std::unique_ptr<tflite::TensorT>> &tflite_tensors,
const std::vector<std::unique_ptr<tflite::BufferT>> &tflite_model_buffer,
const std::vector<std::unique_ptr<tflite::OperatorCodeT>> &tflite_opset,
schema::CNodeT *op,
TensorCache *tensor_cache, bool quantized_model) {
MS_LOG(DEBUG) << "parse TfliteRealDivParser";
std::unique_ptr<schema::RealDivT> attr(new schema::RealDivT());
if (op != nullptr) {
op->primitive = std::make_unique<schema::PrimitiveT>();
op->primitive->value.type = schema::PrimitiveType_RealDiv;
op->primitive->value.value = attr.release();
}
return RET_OK;
}
TfliteNodeRegister g_tfliteRealDivParser("RealDiv", new TfliteRealDivParser());
} // namespace lite
} // namespace mindspore
/**
* Copyright 2020 Huawei Technologies Co., Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef LITE_TFLITE_REAL_DIV_PARSER_H
#define LITE_TFLITE_REAL_DIV_PARSER_H
#include <memory>
#include <vector>
#include "tools/converter/parser/tflite/tflite_node_parser.h"
#include "tools/converter/parser/tflite/tflite_node_parser_registry.h"
namespace mindspore {
namespace lite {
class TfliteRealDivParser : public TfliteNodeParser {
public:
TfliteRealDivParser() : TfliteNodeParser("RealDiv") {}
STATUS Parse(const std::unique_ptr<tflite::OperatorT> &tflite_op,
const std::vector<std::unique_ptr<tflite::TensorT>> &tflite_tensors,
const std::vector<std::unique_ptr<tflite::BufferT>> &tflite_model_buffer,
const std::vector<std::unique_ptr<tflite::OperatorCodeT>> &tflite_opset, schema::CNodeT *op,
TensorCache *tensor_cache,
bool quantized_model) override;
};
} // namespace lite
} // namespace mindspore
#endif // LITE_TFLITE_REAL_DIV_PARSER_H
......@@ -16,7 +16,7 @@
#include <memory>
#include <vector>
#include "mindspore/lite/tools/converter/parser/tflite/tflite_relu6_parser.h"
#include "tools/converter/parser/tflite/tflite_relu6_parser.h"
namespace mindspore {
namespace lite {
......
......@@ -17,8 +17,8 @@
#ifndef PREDICT_TFLITE_RELU6_PARSER_H
#define PREDICT_TFLITE_RELU6_PARSER_H
#include "mindspore/lite/tools/converter/parser/tflite/tflite_node_parser.h"
#include "mindspore/lite/tools/converter/parser/tflite/tflite_node_parser_registry.h"
#include "tools/converter/parser/tflite/tflite_node_parser.h"
#include "tools/converter/parser/tflite/tflite_node_parser_registry.h"
#include <vector>
#include <memory>
......
......@@ -16,7 +16,7 @@
#include <memory>
#include <vector>
#include "mindspore/lite/tools/converter/parser/tflite/tflite_relu_parser.h"
#include "tools/converter/parser/tflite/tflite_relu_parser.h"
namespace mindspore {
namespace lite {
......
......@@ -17,8 +17,8 @@
#ifndef PREDICT_TFLITE_RELU_PARSER_H
#define PREDICT_TFLITE_RELU_PARSER_H
#include "mindspore/lite/tools/converter/parser/tflite/tflite_node_parser.h"
#include "mindspore/lite/tools/converter/parser/tflite/tflite_node_parser_registry.h"
#include "tools/converter/parser/tflite/tflite_node_parser.h"
#include "tools/converter/parser/tflite/tflite_node_parser_registry.h"
#include <vector>
#include <memory>
......
......@@ -16,7 +16,7 @@
#include <vector>
#include <memory>
#include "mindspore/lite/tools/converter/parser/tflite/tflite_reshape_parser.h"
#include "tools/converter/parser/tflite/tflite_reshape_parser.h"
namespace mindspore {
namespace lite {
......
......@@ -19,8 +19,8 @@
#include <memory>
#include <vector>
#include "mindspore/lite/tools/converter/parser/tflite/tflite_node_parser.h"
#include "mindspore/lite/tools/converter/parser/tflite/tflite_node_parser_registry.h"
#include "tools/converter/parser/tflite/tflite_node_parser.h"
#include "tools/converter/parser/tflite/tflite_node_parser_registry.h"
namespace mindspore {
namespace lite {
......
......@@ -16,7 +16,7 @@
#include <vector>
#include <memory>
#include "mindspore/lite/tools/converter/parser/tflite/tflite_resize_bilinear_parser.h"
#include "tools/converter/parser/tflite/tflite_resize_bilinear_parser.h"
namespace mindspore {
namespace lite {
......
......@@ -19,8 +19,8 @@
#include <memory>
#include <vector>
#include "mindspore/lite/tools/converter/parser/tflite/tflite_node_parser.h"
#include "mindspore/lite/tools/converter/parser/tflite/tflite_node_parser_registry.h"
#include "tools/converter/parser/tflite/tflite_node_parser.h"
#include "tools/converter/parser/tflite/tflite_node_parser_registry.h"
namespace mindspore {
namespace lite {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册