aboutsummaryrefslogtreecommitdiff
path: root/ethosu/vela/shape4d.py
diff options
context:
space:
mode:
authorpatrik.gustavsson <patrik.gustavsson@arm.com>2020-12-21 16:56:26 +0000
committerpatrik.gustavsson <patrik.gustavsson@arm.com>2020-12-21 16:56:26 +0000
commitdf0a5905177f3a1b836076bc3f9f39b2e86f1794 (patch)
treeb5151d0f12428e47d64b1fb2ce4f2f8c19304a0d /ethosu/vela/shape4d.py
parentbf31d647dc5df47410ee577b12427ddf076d816b (diff)
downloadethos-u-vela-df0a5905177f3a1b836076bc3f9f39b2e86f1794.tar.gz
Revert "MLBEDSW-3645 4D class for op ifm/ofm shapes"
This reverts commit bf31d647dc5df47410ee577b12427ddf076d816b. Reason for revert: <INSERT REASONING HERE> Change-Id: I7b6c585b7658f94dbaa916c2b6bfe9fb463b8d37
Diffstat (limited to 'ethosu/vela/shape4d.py')
-rw-r--r--ethosu/vela/shape4d.py77
1 files changed, 0 insertions, 77 deletions
diff --git a/ethosu/vela/shape4d.py b/ethosu/vela/shape4d.py
deleted file mode 100644
index a1b4feaa..00000000
--- a/ethosu/vela/shape4d.py
+++ /dev/null
@@ -1,77 +0,0 @@
-# Copyright (C) 2020 Arm Limited or its affiliates. All rights reserved.
-#
-# SPDX-License-Identifier: Apache-2.0
-#
-# Licensed under the Apache License, Version 2.0 (the License); you may
-# not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an AS IS BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-# Description:
-# Defines the class Shape4D.
-from .numeric_util import full_shape
-
-
-class Shape4D:
- """
- 4D Shape (in NHWC format)
- """
-
- def __init__(self, shape, base=1):
- assert shape is not None
- assert len(shape) <= 4
- self._shape4D = tuple(full_shape(4, shape, base))
-
- def __str__(self):
- return f"<Shape4D {self.as_list()}>"
-
- def __eq__(self, other):
- return self._shape4D == other._shape4D
-
- def clone(self):
- return Shape4D(self.as_list())
-
- @property
- def batch(self):
- return self._shape4D[0]
-
- @property
- def height(self):
- return self._shape4D[1]
-
- @property
- def width(self):
- return self._shape4D[2]
-
- @property
- def depth(self):
- return self._shape4D[3]
-
- @batch.setter
- def batch(self, new_batch):
- self._shape4D = (new_batch, self._shape4D[1], self._shape4D[2], self._shape4D[3])
-
- @height.setter
- def height(self, new_height):
- self._shape4D = (self._shape4D[0], new_height, self._shape4D[2], self._shape4D[3])
-
- @width.setter
- def width(self, new_width):
- self._shape4D = (self._shape4D[0], self._shape4D[1], new_width, self._shape4D[3])
-
- @depth.setter
- def depth(self, new_depth):
- self._shape4D = (self._shape4D[0], self._shape4D[1], self._shape4D[2], new_depth)
-
- def get_dim(self, dim):
- assert -4 <= dim < 4
- return self._shape4D[dim]
-
- def as_list(self):
- return list(self._shape4D)