Skip to content

Commit

Permalink
Reformat
Browse files Browse the repository at this point in the history
  • Loading branch information
strongoier committed Dec 28, 2021
1 parent 9b630f1 commit fea6d27
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 15 deletions.
2 changes: 0 additions & 2 deletions python/taichi/lang/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,6 @@ def reset():


class _EnvironmentConfigurator:

def __init__(self, kwargs, _cfg):
self.cfg = _cfg
self.kwargs = kwargs
Expand Down Expand Up @@ -864,7 +863,6 @@ def deactivate_all_snodes():


def benchmark(_func, repeat=300, args=()):

def run_benchmark():
compile_time = time.time()
_func(*args) # compile the kernel first
Expand Down
4 changes: 0 additions & 4 deletions python/taichi/lang/impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,6 @@ def insert_expr_stmt_if_ti_func(func, *args, **kwargs):


class PyTaichi:

def __init__(self, kernels=None):
self.materialized = False
self.prog = None
Expand Down Expand Up @@ -489,7 +488,6 @@ def index_nd(dim):


class _UninitializedRootFieldsBuilder:

def __getattr__(self, item):
if item == '__qualname__':
# For sphinx docstring extraction.
Expand All @@ -514,7 +512,6 @@ def __getattr__(self, item):

class _Root:
"""Wrapper around the default root FieldsBuilder instance."""

@staticmethod
def parent(n=1):
"""Same as :func:`taichi.SNode.parent`"""
Expand Down Expand Up @@ -668,7 +665,6 @@ def ndarray(dtype, shape):

@taichi_scope
def ti_print(*_vars, sep=' ', end='\n'):

def entry2content(_var):
if isinstance(_var, str):
return _var
Expand Down
7 changes: 0 additions & 7 deletions python/taichi/lang/matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,6 @@ def fill(self, val):
Args:
val (Union[int, float]): Value to fill.
"""

def assign_renamed(x, y):
return ops_mod.assign(x, y)

Expand Down Expand Up @@ -1076,7 +1075,6 @@ class _IntermediateMatrix(Matrix):
m (int): Number of columns of the matrix.
entries (List[Expr]): All entries of the matrix.
"""

def __init__(self, n, m, entries):
assert isinstance(entries, list)
assert n * m == len(entries), "Number of entries doesn't match n * m"
Expand All @@ -1095,7 +1093,6 @@ class _MatrixFieldElement(_IntermediateMatrix):
field (MatrixField): The matrix field.
indices (taichi_core.ExprGroup): Indices of the element.
"""

def __init__(self, field, indices):
super().__init__(field.n, field.m, [
expr.Expr(ti_core.subscript(e.ptr, indices))
Expand All @@ -1112,7 +1109,6 @@ class MatrixField(Field):
n (Int): Number of rows.
m (Int): Number of columns.
"""

def __init__(self, _vars, n, m):
assert len(_vars) == n * m
super().__init__(_vars)
Expand Down Expand Up @@ -1266,7 +1262,6 @@ def __repr__(self):


class MatrixType(CompoundType):

def __init__(self, n, m, dtype):
self.n = n
self.m = m
Expand Down Expand Up @@ -1330,7 +1325,6 @@ class MatrixNdarray(Ndarray):
shape (Union[int, tuple[int]]): Shape of the ndarray.
layout (Layout): Memory layout.
"""

def __init__(self, n, m, dtype, shape, layout):
self.layout = layout
arr_shape = (n, m) + shape if layout == Layout.SOA else shape + (n, m)
Expand Down Expand Up @@ -1403,7 +1397,6 @@ class VectorNdarray(Ndarray):
shape (Tuple[int]): Shape of the ndarray.
layout (Layout): Memory layout.
"""

def __init__(self, n, dtype, shape, layout):
self.layout = layout
arr_shape = (n, ) + shape if layout == Layout.SOA else shape + (n, )
Expand Down
2 changes: 0 additions & 2 deletions tests/python/test_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,6 @@ def run():

@ti.test()
def test_matrix_non_constant_index_numpy():

@ti.kernel
def func1(a: ti.any_arr(element_dim=2)):
for i in range(5):
Expand Down Expand Up @@ -345,7 +344,6 @@ def test():

@ti.test(debug=True)
def test_copy_matrix_in_taichi_scope():

@ti.kernel
def test():
a = ti.Vector([1, 2, 3])
Expand Down

0 comments on commit fea6d27

Please sign in to comment.