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

Weird print output when a vector is initialized by list comprehension #6927

Closed
neozhaoliang opened this issue Dec 20, 2022 · 2 comments
Closed
Assignees

Comments

@neozhaoliang
Copy link
Contributor

neozhaoliang commented Dec 20, 2022

The print output is wrong:

import taichi as ti
ti.init(arch=ti.cpu)

@ti.kernel
def main():
    v = ti.Vector([x for x in range(10)])
    print(v)  # 0123456789
main()
@taichi-gardener taichi-gardener moved this to Untriaged in Taichi Lang Dec 20, 2022
@neozhaoliang neozhaoliang changed the title Weird print output a vector Weird print output a vector initialized by list comprehension Dec 20, 2022
@neozhaoliang neozhaoliang changed the title Weird print output a vector initialized by list comprehension Weird print output when a vector is initialized by list comprehension Dec 20, 2022
@strongoier
Copy link
Contributor

This seems related to the scalarization of print. cc: @jim19930609

@jim19930609
Copy link
Contributor

Interesting, let me take this

@jim19930609 jim19930609 self-assigned this Dec 21, 2022
@jim19930609 jim19930609 moved this from Untriaged to Todo in Taichi Lang Dec 21, 2022
@jim19930609 jim19930609 moved this from Todo to In Progress in Taichi Lang Dec 21, 2022
jim19930609 added a commit that referenced this issue Dec 23, 2022
Issue: #6927

### Brief Summary

Co-authored-by: Zhao Liang <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
@github-project-automation github-project-automation bot moved this from In Progress to Done in Taichi Lang Dec 29, 2022
quadpixels pushed a commit to quadpixels/taichi that referenced this issue May 13, 2023
Issue: taichi-dev#6927

### Brief Summary

Co-authored-by: Zhao Liang <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

No branches or pull requests

3 participants