@@ -1900,10 +1900,10 @@ def __init__(self, n, m, dtype, shape, layout):
1900
1900
1901
1901
self .layout = layout
1902
1902
self .shape = tuple (shape )
1903
- self .element_type = TensorType ((self .n , self .m ), self . dtype )
1903
+ self .element_type = TensorType ((self .n , self .m ), dtype )
1904
1904
# TODO: we should pass in element_type, shape, layout instead.
1905
1905
self .arr = impl .get_runtime ().prog .create_ndarray (
1906
- self .element_type , shape , layout )
1906
+ cook_dtype ( self .element_type . ptr ) , shape , layout )
1907
1907
1908
1908
@property
1909
1909
def element_shape (self ):
@@ -1915,7 +1915,7 @@ def element_shape(self):
1915
1915
>>> arr.element_shape
1916
1916
(2, 2)
1917
1917
"""
1918
- return tuple (self .arr .element_shape )
1918
+ return tuple (self .arr .element_shape () )
1919
1919
1920
1920
@python_scope
1921
1921
def __setitem__ (self , key , value ):
@@ -1999,12 +1999,12 @@ def __init__(self, n, dtype, shape, layout):
1999
1999
super ().__init__ ()
2000
2000
# TODO(zhanlue): remove self.dtype and migrate its usages to element_type
2001
2001
self .dtype = cook_dtype (dtype )
2002
+
2002
2003
self .layout = layout
2003
2004
self .shape = tuple (shape )
2004
- self .element_type = TensorType ((n , ), self .dtype )
2005
- # TODO: pass in element_type, shape, layout directly
2005
+ self .element_type = TensorType ((n , ), dtype )
2006
2006
self .arr = impl .get_runtime ().prog .create_ndarray (
2007
- self .element_type , shape , layout )
2007
+ cook_dtype ( self .element_type . ptr ) , shape , layout )
2008
2008
2009
2009
@property
2010
2010
def element_shape (self ):
@@ -2016,7 +2016,7 @@ def element_shape(self):
2016
2016
>>> a.element_shape
2017
2017
(3,)
2018
2018
"""
2019
- return tuple (self .arr .element_shape )
2019
+ return tuple (self .arr .element_shape () )
2020
2020
2021
2021
@python_scope
2022
2022
def __setitem__ (self , key , value ):
0 commit comments