Skip to content

Commit

Permalink
New Gather op reference implementation.
Browse files Browse the repository at this point in the history
  • Loading branch information
Patryk Elszkowski committed Dec 16, 2020
1 parent 61752b8 commit 9947bbe
Show file tree
Hide file tree
Showing 3 changed files with 585 additions and 165 deletions.
10 changes: 9 additions & 1 deletion ngraph/core/reference/include/ngraph/coordinate_range.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ namespace ngraph
bool increment();

bool is_valid() const noexcept { return !has_zeros(m_source_shape); }

private:
const Shape m_source_shape;
const CoordinateBounds m_bounds;
Expand Down Expand Up @@ -185,7 +186,7 @@ namespace ngraph
Strides(source_shape.size(), 1));
}

/// \brief Class allows to iterate over Tensor with reverted axies part by part.
/// \brief Class allows to iterate over Tensor with reverted axes part by part.
///
/// To create ReverseRange use _reverse_ function.
///
Expand All @@ -200,6 +201,7 @@ namespace ngraph
bool increment();

bool is_valid() const noexcept { return !has_zeros(m_source_shape); }

private:
const Shape m_source_shape;
const std::vector<size_t> m_memory_strides;
Expand All @@ -213,8 +215,14 @@ namespace ngraph
return ReverseRange(source_shape, reversed_axis);
}

inline ReverseRange index(const Shape& source_shape)
{
return reverse(source_shape, {});
}

} // namespace impl
using impl::Direction;
using impl::index;
using impl::reverse;
using impl::slice;
} // namespace coordinates
Expand Down
Loading

0 comments on commit 9947bbe

Please sign in to comment.