You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When printing ndarray with ti.f64 datatype in Python scope, the results are not correct.
To Reproduce
Please post a minimal sample code to reproduce the bug.
The developer team will put a higher priority on bugs that can be reproduced within 20 lines of code. If you want a prompt reply, please keep the sample code short and representative.
importtaichiastiti.init(arch=ti.cpu)
n=3dtype=ti.f64# when dtype is ti.f32, the output is correctx=ti.ndarray(dtype, n)
@ti.kerneldefinit(x: ti.types.ndarray(dtype=dtype)):
foriinx:
x[i] =i+1.0@ti.kerneldefprint_n(x: ti.types.ndarray(dtype=dtype)):
foriinx:
print(x[i])
init(x)
print("print ndarray in Taichi scope")
print_n(x)
print("print ndarray in Python scope")
foriinrange(n):
print(x[i])
Log/Screenshots
[Taichi] version 1.3.0, llvm 10.0.0, commit ede76d22, linux, python 3.8.13
[Taichi] Starting on arch=x64
print ndarray in Taichi scope
1.000000000000
2.000000000000
3.000000000000
print ndarray in Python scope
0.0
1.875
0.0
The text was updated successfully, but these errors were encountered:
Issue: fix#6650
### Brief Summary
The original implementation hardcodes `int`, `uint` and `float`, which
only allows reading 32-bit data out. This PR fixes the behavior by
leveraging `TypedConstant`.
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
…v#6836)
Issue: fixtaichi-dev#6650
### Brief Summary
The original implementation hardcodes `int`, `uint` and `float`, which
only allows reading 32-bit data out. This PR fixes the behavior by
leveraging `TypedConstant`.
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Describe the bug
When printing ndarray with
ti.f64
datatype in Python scope, the results are not correct.To Reproduce
Please post a minimal sample code to reproduce the bug.
The developer team will put a higher priority on bugs that can be reproduced within 20 lines of code. If you want a prompt reply, please keep the sample code short and representative.
Log/Screenshots
The text was updated successfully, but these errors were encountered: