aboutsummaryrefslogtreecommitdiff
path: root/tests/validation/reference/Utils.h
diff options
context:
space:
mode:
Diffstat (limited to 'tests/validation/reference/Utils.h')
-rw-r--r--tests/validation/reference/Utils.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/validation/reference/Utils.h b/tests/validation/reference/Utils.h
index 2aa77c6ff7..0e98bbe82b 100644
--- a/tests/validation/reference/Utils.h
+++ b/tests/validation/reference/Utils.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017 ARM Limited.
+ * Copyright (c) 2017-2018 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -62,11 +62,13 @@ T tensor_elem_at(const SimpleTensor<T> &src, Coordinates coord, BorderMode borde
{
const int x = coord.x();
const int y = coord.y();
+ const int z = coord.z();
const int width = src.shape().x();
const int height = src.shape().y();
+ const int depth = src.shape().z();
// If coordinates beyond range of tensor's width or height
- if(x < 0 || y < 0 || x >= width || y >= height)
+ if(x < 0 || y < 0 || z < 0 || x >= width || y >= height || z >= depth)
{
if(border_mode == BorderMode::REPLICATE)
{