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/debug_database.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/debug_database.py')
-rw-r--r-- | ethosu/vela/debug_database.py | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/ethosu/vela/debug_database.py b/ethosu/vela/debug_database.py index b5852cdc..4f0a50ae 100644 --- a/ethosu/vela/debug_database.py +++ b/ethosu/vela/debug_database.py @@ -15,6 +15,9 @@ # limitations under the License. import csv import io +from typing import Any +from typing import Dict +from typing import List import lxml.etree as xml @@ -22,28 +25,32 @@ from . import numeric_util from .operation import Operation +UntypedDict = Dict[Any, Any] +UntypedList = List[Any] + + class DebugDatabase: NULLREF = -1 show_warnings = False SOURCE_TABLE = "source" - _sourceUID = {} + _sourceUID: UntypedDict = {} _sourceHeaders = ["id", "operator", "kernel_w", "kernel_h", "ofm_w", "ofm_h", "ofm_d"] - _sourceTable = [] + _sourceTable: UntypedList = [] OPTIMISED_TABLE = "optimised" - _optimisedUID = {} + _optimisedUID: UntypedDict = {} _optimisedHeaders = ["id", "source_id", "operator", "kernel_w", "kernel_h", "ofm_w", "ofm_h", "ofm_d"] - _optimisedTable = [] + _optimisedTable: UntypedList = [] QUEUE_TABLE = "queue" _queueHeaders = ["offset", "cmdstream_id", "optimised_id"] - _queueTable = [] + _queueTable: UntypedList = [] STREAM_TABLE = "cmdstream" - _streamUID = {} + _streamUID: UntypedDict = {} _streamHeaders = ["id", "file_offset"] - _streamTable = [] + _streamTable: UntypedList = [] @classmethod def add_source(cls, op: Operation): |