diff --git a/python/taichi/lang/field.py b/python/taichi/lang/field.py index 2a6eb310346d5..e699b2a2b8052 100644 --- a/python/taichi/lang/field.py +++ b/python/taichi/lang/field.py @@ -44,7 +44,7 @@ def dtype(self): Returns: DataType: Data type of each individual value. """ - return self.snode.dtype + return self.snode._dtype @property def name(self): diff --git a/python/taichi/lang/matrix.py b/python/taichi/lang/matrix.py index cf7bcc4a64e60..b9c208eb80450 100644 --- a/python/taichi/lang/matrix.py +++ b/python/taichi/lang/matrix.py @@ -1124,7 +1124,7 @@ def calc_dynamic_index_stride(self): length = len(paths[0]) if any( len(path) != length or ti_core.is_custom_type(path[length - - 1].dtype) + 1]._dtype) for path in paths): return for i in range(length): diff --git a/python/taichi/lang/snode.py b/python/taichi/lang/snode.py index 7b262a4499056..e2f19b52639e8 100644 --- a/python/taichi/lang/snode.py +++ b/python/taichi/lang/snode.py @@ -201,7 +201,7 @@ def _path_from_root(self): return res @property - def dtype(self): + def _dtype(self): """Gets the data type of `self`. Returns: @@ -255,15 +255,6 @@ def snode(self): """ return self - @property - def needs_grad(self): - """Checks whether `self` has a corresponding gradient :class:`~taichi.lang.SNode`. - - Returns: - bool: Whether `self` has a corresponding gradient :class:`~taichi.lang.SNode`. - """ - return self.ptr.has_grad() - def _get_children(self): """Gets all children components of `self`.