Skip to content

Commit

Permalink
Fix code-style
Browse files Browse the repository at this point in the history
  • Loading branch information
mvafin committed May 12, 2021
1 parent a7cacf0 commit df7ab69
Show file tree
Hide file tree
Showing 68 changed files with 2,660 additions and 1,954 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,48 +20,52 @@

#include "model.hpp"

namespace ngraph {
namespace frontend {

class NGRAPH_API FrontEndPDPD : public FrontEnd
namespace ngraph
{
static std::shared_ptr<Function> convert_model(const std::shared_ptr<InputModelPDPD>& model);
public:

FrontEndPDPD ()
namespace frontend
{
}
class NGRAPH_API FrontEndPDPD : public FrontEnd
{
static std::shared_ptr<Function>
convert_model(const std::shared_ptr<InputModelPDPD>& model);

public:
FrontEndPDPD() {}

/**
* @brief Reads model from file and deducts file names of weights
* @param path path to folder which contains __model__ file or path to .pdmodel file
* @return InputModel::Ptr
*/
virtual InputModel::Ptr loadFromFile (const std::string& path) const override;
/**
* @brief Reads model from file and deducts file names of weights
* @param path path to folder which contains __model__ file or path to .pdmodel file
* @return InputModel::Ptr
*/
virtual InputModel::Ptr loadFromFile(const std::string& path) const override;

/**
* @brief Reads model and weights from files
* @param paths vector containing path to .pdmodel and .pdiparams files
* @return InputModel::Ptr
*/
virtual InputModel::Ptr loadFromFiles (const std::vector<std::string>& paths) const override;
/**
* @brief Reads model and weights from files
* @param paths vector containing path to .pdmodel and .pdiparams files
* @return InputModel::Ptr
*/
virtual InputModel::Ptr
loadFromFiles(const std::vector<std::string>& paths) const override;

/**
* @brief Reads model from stream
* @param model_stream stream containing .pdmodel or __model__ files. Can only be used if model have no weights
* @return InputModel::Ptr
*/
virtual InputModel::Ptr loadFromStream (std::istream& model_stream) const override;
/**
* @brief Reads model from stream
* @param model_stream stream containing .pdmodel or __model__ files. Can only be used
* if model have no weights
* @return InputModel::Ptr
*/
virtual InputModel::Ptr loadFromStream(std::istream& model_stream) const override;

/**
* @brief Reads model from stream
* @param paths vector of streams containing .pdmodel and .pdiparams files. Can't be used in case of multiple weight files
* @return InputModel::Ptr
*/
virtual InputModel::Ptr loadFromStreams (const std::vector<std::istream*>& paths) const override;
/**
* @brief Reads model from stream
* @param paths vector of streams containing .pdmodel and .pdiparams files. Can't be
* used in case of multiple weight files
* @return InputModel::Ptr
*/
virtual InputModel::Ptr
loadFromStreams(const std::vector<std::istream*>& paths) const override;

virtual std::shared_ptr<Function> convert (InputModel::Ptr model) const override;
};
virtual std::shared_ptr<Function> convert(InputModel::Ptr model) const override;
};

} // namespace frontend
} // namespace frontend
} // namespace ngraph
Original file line number Diff line number Diff line change
Expand Up @@ -18,38 +18,39 @@

#include <frontend_manager/frontend_manager.hpp>

namespace ngraph {
namespace frontend {

class OpPlacePDPD;
class TensorPlacePDPD;

class NGRAPH_API InputModelPDPD : public InputModel
namespace ngraph
{
friend class FrontEndPDPD;
class InputModelPDPDImpl;
std::shared_ptr<InputModelPDPDImpl> _impl;

std::vector<std::shared_ptr<OpPlacePDPD>> getOpPlaces() const;
std::map<std::string, std::shared_ptr<TensorPlacePDPD>> getVarPlaces() const;
std::map<std::string, Output<Node>> getTensorValues() const;

public:
explicit InputModelPDPD (const std::string& path);
explicit InputModelPDPD (const std::vector<std::istream*>& streams);
std::vector<Place::Ptr> getInputs () const override;
std::vector<Place::Ptr> getOutputs () const override;
Place::Ptr getPlaceByTensorName (const std::string& tensorName) const override;
void overrideAllOutputs (const std::vector<Place::Ptr>& outputs) override;
void overrideAllInputs (const std::vector<Place::Ptr>& inputs) override;
void extractSubgraph (const std::vector<Place::Ptr>& inputs, const std::vector<Place::Ptr>& outputs) override;
void setDefaultShape (Place::Ptr place, const ngraph::Shape&) override;
void setPartialShape (Place::Ptr place, const ngraph::PartialShape&) override;
ngraph::PartialShape getPartialShape (Place::Ptr place) const override;
void setElementType (Place::Ptr place, const ngraph::element::Type&) override;
void setTensorValue (Place::Ptr place, const void* value) override;

};

} // namespace frontend
namespace frontend
{
class OpPlacePDPD;
class TensorPlacePDPD;

class NGRAPH_API InputModelPDPD : public InputModel
{
friend class FrontEndPDPD;
class InputModelPDPDImpl;
std::shared_ptr<InputModelPDPDImpl> _impl;

std::vector<std::shared_ptr<OpPlacePDPD>> getOpPlaces() const;
std::map<std::string, std::shared_ptr<TensorPlacePDPD>> getVarPlaces() const;
std::map<std::string, Output<Node>> getTensorValues() const;

public:
explicit InputModelPDPD(const std::string& path);
explicit InputModelPDPD(const std::vector<std::istream*>& streams);
std::vector<Place::Ptr> getInputs() const override;
std::vector<Place::Ptr> getOutputs() const override;
Place::Ptr getPlaceByTensorName(const std::string& tensorName) const override;
void overrideAllOutputs(const std::vector<Place::Ptr>& outputs) override;
void overrideAllInputs(const std::vector<Place::Ptr>& inputs) override;
void extractSubgraph(const std::vector<Place::Ptr>& inputs,
const std::vector<Place::Ptr>& outputs) override;
void setDefaultShape(Place::Ptr place, const ngraph::Shape&) override;
void setPartialShape(Place::Ptr place, const ngraph::PartialShape&) override;
ngraph::PartialShape getPartialShape(Place::Ptr place) const override;
void setElementType(Place::Ptr place, const ngraph::element::Type&) override;
void setTensorValue(Place::Ptr place, const void* value) override;
};

} // namespace frontend
} // namespace ngraph
Loading

0 comments on commit df7ab69

Please sign in to comment.