diff options
author | Patrik Gustavsson <patrik.gustavsson@arm.com> | 2021-09-21 14:18:44 +0200 |
---|---|---|
committer | Patrik Gustavsson <patrik.gustavsson@arm.com> | 2021-09-21 14:37:10 +0200 |
commit | 3f22ec2025c8e1afe6780785fd8c62c015824a63 (patch) | |
tree | b7d3324def750afc3a0f4806b195872069e08b62 /ethosu/vela/shape4d.py | |
parent | 46408a8049f6a51dda5bfa8a4c9959e037120265 (diff) | |
download | ethos-u-vela-3f22ec2025c8e1afe6780785fd8c62c015824a63.tar.gz |
TOSA: Decompose elem op tensors
Added decomposition of tensors exceeding
maximum size supported by NPU.
Signed-off-by: Patrik Gustavsson <patrik.gustavsson@arm.com>
Change-Id: I17a99cb72947d2f1064a631ad6975ce895c258d5
Diffstat (limited to 'ethosu/vela/shape4d.py')
-rw-r--r-- | ethosu/vela/shape4d.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/ethosu/vela/shape4d.py b/ethosu/vela/shape4d.py index 08b2a6a0..fd1ee949 100644 --- a/ethosu/vela/shape4d.py +++ b/ethosu/vela/shape4d.py @@ -111,6 +111,9 @@ class Shape4D(namedtuple("Shape4D", ["batch", "height", "width", "depth"])): def __sub__(self, rhs): return Shape4D(self.batch - rhs.batch, self.height - rhs.height, self.width - rhs.width, self.depth - rhs.depth) + def floordiv_const(self, const): + return Shape4D(self.batch // const, self.height // const, self.width // const, self.depth // const) + def __floordiv__(self, rhs): return Shape4D( self.batch // rhs.batch, self.height // rhs.height, self.width // rhs.width, self.depth // rhs.depth |