Skip to content

Reference implementation for Tile op#2641

Merged
postrational merged 32 commits intoopenvinotoolkit:masterfrom
pszmel:tile_ref_impl
Oct 23, 2020
Merged

Reference implementation for Tile op#2641
postrational merged 32 commits intoopenvinotoolkit:masterfrom
pszmel:tile_ref_impl

Conversation

@pszmel
Copy link
Copy Markdown
Contributor

@pszmel pszmel commented Oct 13, 2020

Change tile reference implementation to make it work faster (remove CoordinateTransform). Also remove 2 tests from interpreter manifest

@pszmel pszmel added the category: Core OpenVINO Core (aka ngraph) label Oct 13, 2020
@pszmel pszmel requested a review from jdanieck October 13, 2020 09:01
@pszmel pszmel self-assigned this Oct 13, 2020
@pszmel pszmel requested a review from ggalieroc-zz October 13, 2020 09:13
@pszmel pszmel force-pushed the tile_ref_impl branch 2 times, most recently from 72bda1b to 1744af5 Compare October 13, 2020 23:17
@pszmel pszmel marked this pull request as ready for review October 14, 2020 12:55
@pszmel pszmel requested review from a team, dmitry-gorokhov, e-nugmanova, iefode, mbencer, mikhail-treskin and slyalin and removed request for a team October 14, 2020 12:55
const char* arg, char* out, const Shape& in_shape, const Shape& out_shape, size_t elem_size)
namespace
{
bool is_axis_upper_bound(const Shape& shape,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you remove the run param from this function and check axis-- == 0 in the main loop?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Decrement of axis should happen in every iteration of inner while loop. If I move this check to the main loop it will decrease only once.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using struct that keep track of indices, axis and run may be the good solution. Additionally this structure can have is axis upper_bound method.

memcpy(out + output_transform.index(output_coord) * elem_size,
arg + input_transform.index(input_coord) * elem_size,
elem_size);
while (is_axis_upper_bound(indices, axis, in_shape_expanded))
Copy link
Copy Markdown
Contributor

@mbencer mbencer Oct 20, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on the name is_axis_upper_bound user doesn't know that input params are changed which can be confused.
I think that more clear will be changing it to
calculate_next_axis()

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point! :)

Copy link
Copy Markdown
Contributor

@postrational postrational left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At this point code LGTM.
Can we add a few lines of comments to describe what each loop should be doing?

@postrational postrational self-requested a review October 22, 2020 07:48
@ilyachur
Copy link
Copy Markdown
Contributor

@postrational Please take a look one more time at this PR.

@postrational postrational merged commit 85b0683 into openvinotoolkit:master Oct 23, 2020
mryzhov pushed a commit to mryzhov/openvino that referenced this pull request Dec 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

category: Core OpenVINO Core (aka ngraph)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants