aboutsummaryrefslogtreecommitdiff
path: root/arm_compute/core/Window.inl
diff options
context:
space:
mode:
Diffstat (limited to 'arm_compute/core/Window.inl')
-rw-r--r--arm_compute/core/Window.inl20
1 files changed, 20 insertions, 0 deletions
diff --git a/arm_compute/core/Window.inl b/arm_compute/core/Window.inl
index 8401227eee..c6fc8848aa 100644
--- a/arm_compute/core/Window.inl
+++ b/arm_compute/core/Window.inl
@@ -247,4 +247,24 @@ inline void Window::use_tensor_dimensions(const TensorShape &shape, size_t first
set(n, Window::Dimension(0, std::max(shape[n], static_cast<size_t>(1))));
}
}
+
+inline TensorShape Window::shape() const
+{
+ TensorShape shape;
+ for(size_t d = 0; d < TensorShape::num_max_dimensions; ++d)
+ {
+ shape.set(d, (_dims[d].end() - _dims[d].start()) / _dims[d].step());
+ }
+ return shape;
+}
+
+inline size_t Window::num_iterations_total() const
+{
+ size_t total = 1;
+ for(size_t d = 0; d < Coordinates::num_max_dimensions; ++d)
+ {
+ total *= num_iterations(d);
+ }
+ return total;
+}
}