fix shape types

This commit is contained in:
George Hotz
2023-01-26 22:29:20 -08:00
parent 026ba78526
commit f4b571039b
2 changed files with 15 additions and 15 deletions

View File

@@ -1,15 +1,15 @@
repos:
- repo: local
hooks:
- id: pylint
name: pylint
entry: pylint tinygrad/
language: system
always_run: true
pass_filenames: false
- id: mypy
name: mypy
entry: mypy tinygrad/ --ignore-missing-imports
language: system
always_run: true
pass_filenames: false
- repo: local
hooks:
- id: pylint
name: pylint
entry: pylint tinygrad/
language: system
always_run: true
pass_filenames: false
- id: mypy
name: mypy
entry: mypy tinygrad/ --ignore-missing-imports
language: system
always_run: true
pass_filenames: false

View File

@@ -21,7 +21,7 @@ def to_shape_strides(shape:Tuple[int, ...], strides:Tuple[int, ...]) -> List[Tup
return ret
class View:
def __init__(self, shape:Union[Tuple[int, ...],List[Any]], strides:Union[Tuple[int, ...],List[Any]], offset:int=0):
def __init__(self, shape:Union[Tuple[int, ...],List[int]], strides:Union[Tuple[int, ...],List[int]], offset:int=0):
self.shape, self.strides, self.offset = tuple(shape), tuple(strides), offset
self.shape_strides = to_shape_strides(self.shape, self.strides)