commit
de857161ed
@ -0,0 +1 @@
|
||||
ssd.pb
|
@ -0,0 +1,35 @@
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
#include <vector>
|
||||
#include <memory>
|
||||
#include "tools/anf_importer/anf_populater/anf_node_populater_registry.h"
|
||||
#include "tools/anf_importer/anf_populater/anf_make_tuple_populater.h"
|
||||
#include "ir/func_graph.h"
|
||||
#include "ir/primitive.h"
|
||||
|
||||
namespace mindspore::lite {
|
||||
int AnfMakeTuplePopulater::Populate(const PrimitivePtr &prim, PrimitiveTValue *primitiveTValuePtr,
|
||||
const std::vector<AnfNodePtr> &inputs) {
|
||||
auto primitive = std::make_unique<schema::PrimitiveT>();
|
||||
auto attr = std::make_unique<schema::MakeTupleT>();
|
||||
primitive->value.type = schema::PrimitiveType_MakeTuple;
|
||||
primitive->value.value = attr.release();
|
||||
MS_ASSERT(primitiveTValuePtr != nullptr);
|
||||
primitiveTValuePtr->SetPrimitiveT(primitive.release());
|
||||
return 0;
|
||||
}
|
||||
AnfNodePopulaterRegistrar anfMakeTuplePopulater("make_tuple", new AnfMakeTuplePopulater());
|
||||
} // namespace mindspore::lite
|
@ -0,0 +1,29 @@
|
||||
/**
|
||||
* 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 MINDSPORE_ANF_MAKE_TUPLE_PARSER_H
|
||||
#define MINDSPORE_ANF_MAKE_TUPLE_PARSER_H
|
||||
#include "tools/anf_importer/anf_populater/anf_node_populater.h"
|
||||
#include <vector>
|
||||
namespace mindspore::lite {
|
||||
class AnfMakeTuplePopulater : public AnfNodePopulater {
|
||||
public:
|
||||
AnfMakeTuplePopulater() = default;
|
||||
~AnfMakeTuplePopulater() override = default;
|
||||
int Populate(const PrimitivePtr &prim, PrimitiveTValue *primitiveTValuePtr,
|
||||
const std::vector<AnfNodePtr> &inputs) override;
|
||||
};
|
||||
} // namespace mindspore::lite
|
||||
#endif // MINDSPORE_ANF_MAKE_TUPLE_PARSER_H
|
Loading…
Reference in new issue