-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[OV20] Layout class implementation - basic API #7452
Conversation
- Removed setters - Removed LayoutRank from public classes
int64_t m_right_size = 0; | ||
}; | ||
|
||
namespace layouts { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe just layout
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, will change
ngraph/test/layout.cpp
Outdated
TEST(layout, custom_dims) { | ||
Layout l = "0ac"; | ||
EXPECT_FALSE(layouts::has_batch(l)); | ||
EXPECT_ANY_THROW(layouts::batch(l)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why any throw here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, will correct. Also will change exception type from ngraph_error to ov::AssertFailure
- Rename 'layouts' namespace to 'layout' - 'get_index_by_name' - specify throw exception type
static const std::map<std::string, std::string>& dim_aliases() { | ||
static const std::map<std::string, std::string> DIM_ALIASES = {{BATCH, BATCH}, | ||
{"BATCH", BATCH}, | ||
{"B", BATCH}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we really need "B"
as batch? I don't think it's a common name for batch
@jane-intel do you have any advices here?
auto layout = std::dynamic_pointer_cast<VariantWrapper<Layout>>(it->second); | ||
OPENVINO_ASSERT(layout, "Layout runtime info for node is invalid"); | ||
if (!layout::has_channels(layout->get())) { | ||
return -1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-1
means channels is last. Maybe we need different invalid
value?
|
||
static StaticShape construct_mean_scale_shape(const std::shared_ptr<Node>& node, size_t values_size) { | ||
// TODO: support also Mean/Scale image case | ||
auto channels = get_channels_helper(node); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
channels_index
? Channels here seems to be a number of channels itself..
Let's fix comments in next PR together with case when we add mean / scale preprocessing for case |
* Draft * More tests * to_string + advanced_syntax + more tests * Coding style * Add mean/scale - vector version with layout support Vector version requires layout to be set * Added comments to LayoutRank * Removed unnecessary public API - Removed setters - Removed LayoutRank from public classes * Review comments: - Rename 'layouts' namespace to 'layout' - 'get_index_by_name' - specify throw exception type
Details:
Tickets: