Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

type object 'Expr' has no attribute 'layout_materialized' #1335

Closed
vkurenkov opened this issue Jun 25, 2020 · 1 comment · Fixed by #1347
Closed

type object 'Expr' has no attribute 'layout_materialized' #1335

vkurenkov opened this issue Jun 25, 2020 · 1 comment · Fixed by #1347
Labels
potential bug Something that looks like a bug but not yet confirmed welcome contribution

Comments

@vkurenkov
Copy link

vkurenkov commented Jun 25, 2020

Describe the bug
The autodiff_minimization.py/autodiff_regression.py examples are not working in 0.6.13 version but working in 0.6.12

Log/Screenshots

[Taichi] mode=release
[Taichi] version 0.6.13, llvm 10.0.0, commit e8d87357, python 3.7.6
Traceback (most recent call last):
  File "autodiff_minimization.py", line 18, in <module>
    x[i] = random.random()
  File "/home/vkurenkov/.anaconda3/lib/python3.7/site-packages/taichi/lang/util.py", line 212, in wrapped
    return func(*args, **kwargs)
  File "/home/vkurenkov/.anaconda3/lib/python3.7/site-packages/taichi/lang/expr.py", line 39, in __setitem__
    impl.get_runtime().try_materialize()
  File "/home/vkurenkov/.anaconda3/lib/python3.7/site-packages/taichi/lang/impl.py", line 166, in try_materialize
    if not Expr.layout_materialized:
AttributeError: type object 'Expr' has no attribute 'layout_materialized'

To Reproduce

# Install target version
pip install taichi==0.6.13

# Pull the example
git clone https://github.com/taichi-dev/taichi.git
cd taichi/examples/

# Run the example
python autodiff_minimization.py
@vkurenkov vkurenkov added the potential bug Something that looks like a bug but not yet confirmed label Jun 25, 2020
@yuanming-hu
Copy link
Member

Thanks for reporting. This can be fixed by adding ti.init() at the beginning of the example. It's also worth checking if an ti.init is missing in any other examples.

If anyone's interested in fixing this, please go ahead and PR. Thanks in advance!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
potential bug Something that looks like a bug but not yet confirmed welcome contribution
Projects
None yet
2 participants