Skip to content

Commit b72e893

Browse files
committed
[mlgo] Fix type annotation in log_reader, for older python3 versions
1 parent a7686db commit b72e893

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

llvm/lib/Analysis/models/log_reader.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import json
99
import math
1010
import sys
11-
from typing import Optional
11+
from typing import List, Optional
1212

1313
_element_types = {
1414
'float': ctypes.c_float,
@@ -28,7 +28,7 @@
2828
class TensorSpec:
2929
name: str
3030
port: int
31-
shape: list[int]
31+
shape: List[int]
3232
element_type: type
3333

3434
@staticmethod
@@ -89,7 +89,7 @@ def read_header(f: io.BufferedReader):
8989
def read_one_observation(context: Optional[str],
9090
event_str: str,
9191
f: io.BufferedReader,
92-
tensor_specs: list[TensorSpec],
92+
tensor_specs: List[TensorSpec],
9393
score_spec: Optional[TensorSpec]):
9494
event = json.loads(event_str)
9595
if 'context' in event:

0 commit comments

Comments
 (0)