From 466a28290299fbd78174d7594c87b9909bdb1e95 Mon Sep 17 00:00:00 2001 From: bismarck Date: Mon, 17 Oct 2022 22:43:24 +0800 Subject: [PATCH] [misc] replaced ti.abs with abs --- python/taichi/examples/simulation/laplace_equation.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/taichi/examples/simulation/laplace_equation.py b/python/taichi/examples/simulation/laplace_equation.py index 623da06b0657e..6422ee4947ab7 100644 --- a/python/taichi/examples/simulation/laplace_equation.py +++ b/python/taichi/examples/simulation/laplace_equation.py @@ -155,7 +155,7 @@ def drawArrows(_gui): else: arr = arrows.to_numpy() vel = arr['vel'].reshape(1, -1)[0] - vel = (vel / vel.max() * 0xdd + 0x11) * (ti.abs(fade / fadeMax)) + vel = (vel / vel.max() * 0xdd + 0x11) * (abs(fade / fadeMax)) mean = vel.mean() if mean > 0x7f: vel /= mean / 0x7f # make uniform stream more beautiful @@ -274,7 +274,7 @@ def processGuiEvent(_gui): else: dipoles[i].m += 0.001 * int((dipoles[i].m >= 0.0) - (dipoles[i].m <= 0.0)) - fade = -ti.abs(fade) # fade out arrow filed + fade = -abs(fade) # fade out arrow filed if __name__ == '__main__':