Skip to content

Commit f9c8839

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 428da09 commit f9c8839

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

python/taichi/lang/impl.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -198,14 +198,13 @@ def subscript(value, *_indices, skip_reordered=False):
198198
@taichi_scope
199199
def make_stride_expr(_var, _indices, shape, stride):
200200
return Expr(
201-
_ti_core.make_stride_expr(_var, make_expr_group(*_indices),
202-
shape, stride))
201+
_ti_core.make_stride_expr(_var, make_expr_group(*_indices), shape,
202+
stride))
203203

204204

205205
@taichi_scope
206206
def make_index_expr(_var, _indices):
207-
return Expr(
208-
_ti_core.make_index_expr(_var, make_expr_group(*_indices)))
207+
return Expr(_ti_core.make_index_expr(_var, make_expr_group(*_indices)))
209208

210209

211210
class SrcInfoGuard:

python/taichi/lang/matrix.py

+5-6
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ def check(instance, pattern):
4141

4242
for key_group in KEYGROUP_SET:
4343
for index, attr in enumerate(key_group):
44+
4445
def gen_property(attr, attr_idx, key_group):
4546
checker = make_valid_attribs_checker(key_group)
4647

@@ -121,7 +122,7 @@ def _linearize_entry_id(self, *args):
121122
if len(args) == 1 and isinstance(args[0], (list, tuple)):
122123
args = args[0]
123124
if len(args) == 1:
124-
args = args + (0,)
125+
args = args + (0, )
125126
# TODO(#1004): See if it's possible to support indexing at runtime
126127
for i, a in enumerate(args):
127128
if not isinstance(a, int):
@@ -244,10 +245,8 @@ def _subscript(self, is_global_mat, *indices):
244245
return self.any_array_access.subscript(i, j)
245246
if self.local_tensor_proxy is not None:
246247
if len(indices) == 1:
247-
return impl.make_index_expr(self.local_tensor_proxy,
248-
(i,))
249-
return impl.make_index_expr(self.local_tensor_proxy,
250-
(i, j))
248+
return impl.make_index_expr(self.local_tensor_proxy, (i, ))
249+
return impl.make_index_expr(self.local_tensor_proxy, (i, j))
251250
if impl.current_cfg(
252251
).dynamic_index and is_global_mat and self.dynamic_index_stride:
253252
return impl.make_stride_expr(self.entries[0].ptr, (i, j),
@@ -320,7 +319,7 @@ def with_dynamic_index(self, arr, dt):
320319
list([
321320
impl.make_index_expr(
322321
local_tensor_proxy,
323-
(expr.Expr(i, dtype=primitive_types.i32),))
322+
(expr.Expr(i, dtype=primitive_types.i32), ))
324323
]))
325324
return local_tensor_proxy, mat
326325

0 commit comments

Comments
 (0)