aboutsummaryrefslogtreecommitdiff
path: root/ethosu/vela/shape4d.py
diff options
context:
space:
mode:
Diffstat (limited to 'ethosu/vela/shape4d.py')
-rw-r--r--ethosu/vela/shape4d.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/ethosu/vela/shape4d.py b/ethosu/vela/shape4d.py
index fd674031..08b2a6a0 100644
--- a/ethosu/vela/shape4d.py
+++ b/ethosu/vela/shape4d.py
@@ -136,6 +136,9 @@ class Shape4D(namedtuple("Shape4D", ["batch", "height", "width", "depth"])):
def elements(self):
return self.batch * self.width * self.height * self.depth
+ def dot_prod(self, rhs):
+ return self.batch * rhs.batch + self.width * rhs.width + self.height * rhs.height + self.depth * rhs.depth
+
def elements_wh(self):
return self.width * self.height