Skip to content

Commit

Permalink
Update python/taichi/lang/matrix_ops_utils.py
Browse files Browse the repository at this point in the history
Co-authored-by: Zhanlue Yang <[email protected]>
  • Loading branch information
strongoier and jim19930609 authored Nov 3, 2022
1 parent 13041f5 commit 53bddaa
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions python/taichi/lang/matrix_ops_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ def assert_tensor(m, msg='not tensor type: {}'):
raise TaichiCompilationError(msg.format(type(m)))


# TODO(zhanlue): rearrange to more generic checker functions
# for example: "assert_is_instance(args, indices=[], instances=[], logic='or')"
def assert_vector(v, msg='not a vector: {}'):
if (isinstance(v, Expr) or isinstance(v, Matrix)) and len(
v.get_shape()) == 1:
Expand Down

0 comments on commit 53bddaa

Please sign in to comment.