forked from openvinotoolkit/openvino
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Introduce expression API Co-authored-by: Liubov Batanina <[email protected]>
- Loading branch information
1 parent
9e30e88
commit 6f26df3
Showing
17 changed files
with
156 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#pragma once | ||
|
||
#include <deepworks/placeholder.hpp> | ||
#include <deepworks/shape.hpp> | ||
#include <deepworks/tensor.hpp> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#pragma once | ||
|
||
#include <memory> // shared_ptr | ||
|
||
#include <deepworks/shape.hpp> | ||
|
||
namespace deepworks { | ||
|
||
class Call; | ||
class Placeholder { | ||
public: | ||
explicit Placeholder(const deepworks::Shape& shape); | ||
|
||
const Shape& shape() const; | ||
|
||
// NB: Public for test, but not available for user, | ||
// because Impl isn't exported to public API. | ||
Placeholder(const deepworks::Shape& shape, Call call); | ||
struct Impl; | ||
const Impl& impl() const; | ||
std::shared_ptr<Impl> m_impl; | ||
}; | ||
|
||
} // namespace deepworks |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#pragma once | ||
|
||
#include <vector> | ||
|
||
namespace deepworks { | ||
|
||
using Shape = std::vector<int>; | ||
|
||
} // namespace deepworks; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#include <deepworks/placeholder.hpp> | ||
|
||
#include "call.hpp" | ||
#include "call_impl.hpp" | ||
|
||
deepworks::Call::Call(deepworks::LayerInfo&& info) | ||
: m_impl(new Call::Impl{std::move(info)}) { | ||
} | ||
|
||
void deepworks::Call::pass(std::vector<deepworks::Placeholder>&& args) { | ||
m_impl->args = std::move(args); | ||
} | ||
|
||
deepworks::Placeholder deepworks::Call::create(const deepworks::Shape& shape) { | ||
return deepworks::Placeholder{shape, *this}; | ||
}; | ||
|
||
const deepworks::Call::Impl& deepworks::Call::impl() const { | ||
return *m_impl; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#pragma once | ||
|
||
#include <memory> // shared_ptr | ||
|
||
#include "layer_info.hpp" | ||
|
||
namespace deepworks { | ||
|
||
class Placeholder; | ||
struct Call { | ||
Call() = default; | ||
explicit Call(LayerInfo&&); | ||
|
||
void pass(std::vector<Placeholder>&& args); | ||
|
||
Placeholder create(const Shape& shape); | ||
|
||
struct Impl; | ||
const Impl& impl() const; | ||
std::shared_ptr<Impl> m_impl; | ||
}; | ||
|
||
} // namespace deepworks |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#include "call.hpp" | ||
|
||
namespace deepworks { | ||
|
||
struct Call::Impl { | ||
deepworks::LayerInfo info; | ||
std::vector<Placeholder> args; | ||
}; | ||
|
||
} // namespace deepworks |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#pragma once | ||
|
||
namespace deepworks { | ||
|
||
struct LayerInfo { | ||
std::string name; | ||
std::string type; | ||
}; | ||
|
||
} // namespace deepworks |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#include <deepworks/placeholder.hpp> | ||
|
||
#include "call.hpp" | ||
#include "placeholder_impl.hpp" | ||
|
||
deepworks::Placeholder::Placeholder(const deepworks::Shape& shape, | ||
deepworks::Call call) | ||
: m_impl(new deepworks::Placeholder::Impl{shape, call}) { | ||
} | ||
|
||
deepworks::Placeholder::Placeholder(const deepworks::Shape& shape) | ||
: m_impl(new deepworks::Placeholder::Impl{shape, {}}) { | ||
} | ||
|
||
const deepworks::Shape& deepworks::Placeholder::shape() const { | ||
return m_impl->shape; | ||
} | ||
|
||
const deepworks::Placeholder::Impl& deepworks::Placeholder::impl() const { | ||
return *m_impl; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#pragma once | ||
|
||
#include <optional> | ||
|
||
#include "call.hpp" | ||
|
||
namespace deepworks { | ||
|
||
struct Placeholder::Impl { | ||
deepworks::Shape shape; | ||
// NB: The creator, empty optional if it's input. | ||
std::optional<Call> call; | ||
}; | ||
|
||
} // namespace deepworks |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
#include <tensor.hpp> | ||
#include <deepworks/tensor.hpp> | ||
|
||
#include <numeric> | ||
#include <algorithm> | ||
|
||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters