diff options
author | Dwight Lidman <dwight.lidman@arm.com> | 2020-12-08 17:56:44 +0100 |
---|---|---|
committer | patrik.gustavsson <patrik.gustavsson@arm.com> | 2020-12-14 07:00:24 +0000 |
commit | 9b43f846b144d39bfb0cf16853bf6901c74b6672 (patch) | |
tree | a530dce790bb8e54dad009e11ca4d49d54b52b1d /ethosu/vela/operation.py | |
parent | 94457b175b8646bce089c9924e99686587de8992 (diff) | |
download | ethos-u-vela-9b43f846b144d39bfb0cf16853bf6901c74b6672.tar.gz |
MLBEDSW-3653: Fix type errors in annotated files
This commit corrects a number of type errors
reported by mypy and refactors some parts of
the code which are no longer necessary after
making adjustments to satisfy mypy.
Signed-off-by: Dwight Lidman <dwight.lidman@arm.com>
Change-Id: I16b880b228e57f2a92fb8936f53e94886e0f9f44
Diffstat (limited to 'ethosu/vela/operation.py')
-rw-r--r-- | ethosu/vela/operation.py | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/ethosu/vela/operation.py b/ethosu/vela/operation.py index 45fae217..32cba365 100644 --- a/ethosu/vela/operation.py +++ b/ethosu/vela/operation.py @@ -18,10 +18,17 @@ import copy from collections import namedtuple from enum import Enum +from typing import Any +from typing import Dict +from typing import List from typing import Optional +from typing import TYPE_CHECKING from .numeric_util import full_shape +if TYPE_CHECKING: + from .tensor import Tensor + PointXY = namedtuple("PointXY", "x y") PointXYZ = namedtuple("PointXYZ", "x y z") @@ -392,9 +399,9 @@ class Operation: def __init__(self, op_type: Op, name: str): self.type = op_type self.name = name - self.attrs = {} - self.inputs = [] - self.outputs = [] + self.attrs: Dict[str, Any] = {} + self.inputs: List[Tensor] = [] + self.outputs: List[Tensor] = [] self.flops = 0 self.run_on_npu = True # Fused activation function. If not none: operator code. |