Skip to content

Commit a9996f3

Browse files
authored
[math] Remove the logs that taichi.init() print (#609)
1 parent bde7f8a commit a9996f3

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

brainpy/_src/math/op_register/taichi_aot_based.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
import contextlib
12
import hashlib
23
import inspect
4+
import io
35
import os
46
import pathlib
57
import platform
@@ -173,8 +175,8 @@ def _build_kernel(
173175
arch = ti.cuda
174176
else:
175177
raise ValueError(f'Unknown device: {device}')
176-
177-
ti.init(arch=arch)
178+
with contextlib.redirect_stdout(io.StringIO()):
179+
ti.init(arch=arch)
178180

179181
# check arch is available
180182
if ti.lang.impl.current_cfg().arch != arch:

0 commit comments

Comments
 (0)