Mpm88两处error:ti.sqr() deprecated;to_numpy() 没有 'as_vector'

这两处问题都是跑mpm88发生的,mpm99和mpm128都有类似的问题。首先是ti.sqr error message:

Traceback (most recent call last):
File “D:/Code Repository/Play_taichi/official_examples/mpm88.py”, line 91, in
substep()
File “C:\Users\Jack\AppData\Roaming\Python\Python37\site-packages\taichi\lang\kernel.py”, line 533, in wrapped
return primal(*args, **kwargs)
File “C:\Users\Jack\AppData\Roaming\Python\Python37\site-packages\taichi\lang\kernel.py”, line 463, in call
self.materialize(key=key, args=args, arg_features=arg_features)
File “C:\Users\Jack\AppData\Roaming\Python\Python37\site-packages\taichi\lang\kernel.py”, line 343, in materialize
taichi_kernel = taichi_kernel.define(taichi_ast_generator)
File “C:\Users\Jack\AppData\Roaming\Python\Python37\site-packages\taichi\lang\kernel.py”, line 340, in taichi_ast_generator
compiled()
File “D:/Code Repository/Play_taichi/official_examples/mpm88.py”, line 29, in substep
w = [0.5 * ti.sqr(1.5 - fx), 0.75 - ti.sqr(fx - 1), 0.5 * ti.sqr(fx - 0.5)]
File “C:\Users\Jack\AppData\Roaming\Python\Python37\site-packages\taichi\lang\util.py”, line 174, in wrapped
raise DeprecationWarning(msg)
DeprecationWarning: ti.sqr(x) is deprecated, please use x ** 2 instead

改了两处sqr之后,后面另一个地方又出了问题:
Traceback (most recent call last):
File “D:/Code Repository/Play_taichi/official_examples/mpm88.py”, line 94, in
pos = x.to_numpy(as_vector=True)
TypeError: to_numpy() got an unexpected keyword argument ‘as_vector’

按照提示改了之后,码果然能跑了。请问这正常吗?是新版本更新后的兼容问题,还是我没装对?

0.6.7 mpm88 是正常的。

请下载最新版的examples,以免出现不兼容现象。