aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael McGeagh <michael.mcgeagh@arm.com>2020-08-10 11:35:57 +0100
committerMichael McGeagh <michael.mcgeagh@arm.com>2020-08-12 09:44:18 +0100
commit8d3216f5618bd1a276616f7d7b9956a61abfa973 (patch)
tree37bf593b4cf132d0eeb9b64af4f6c69ac61f0616
parentc5b549b599ff459a29115a48e8f067eaa5891638 (diff)
downloadethos-u-vela-8d3216f5618bd1a276616f7d7b9956a61abfa973.tar.gz
vela: Remove redundant import, reuse existing func
We already import numeric_util so no need to import it again for one func Also replace handcoded full shape code with one already existing in numeric_util Signed-off-by: Michael McGeagh <michael.mcgeagh@arm.com> Change-Id: Ib569409fbfd457a7b4b99006d51d9c43f25a1c2c
-rw-r--r--ethosu/vela/tensor.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/ethosu/vela/tensor.py b/ethosu/vela/tensor.py
index 98487324..35749709 100644
--- a/ethosu/vela/tensor.py
+++ b/ethosu/vela/tensor.py
@@ -23,7 +23,6 @@ import numpy as np
from . import numeric_util
from .data_type import DataType
from .ethos_u55_regs.ethos_u55_regs import resampling_mode
-from .numeric_util import round_up_divide
from .operation import Operation
from .range_set import MemoryRangeSet
@@ -638,7 +637,7 @@ class Tensor:
depth = self.shape[-1]
# Always round up to next boundary
- index = round_up_divide(depth, brick_depth)
+ index = numeric_util.round_up_divide(depth, brick_depth)
# Check boundaries on all but last weight set (which may be shorter
# than the brick we divided it up into)
@@ -682,7 +681,7 @@ class Tensor:
depth = self.shape[-1]
# Always round up to next boundary
- index = round_up_divide(depth, brick_depth)
+ index = numeric_util.round_up_divide(depth, brick_depth)
index = index % 2
if len(self.compressed_values) <= 2:
@@ -733,7 +732,7 @@ class Tensor:
def get_full_shape(self):
d = len(self.shape)
if d in (1, 3):
- return [1] * (4 - d) + self.shape
+ return numeric_util.full_shape(4, self.shape, 1)
elif d == 2:
return [self.shape[0], 1, 1, self.shape[1]]
else: