Open agravier opened 2 months ago
I met the exactly same situation. My wild guess is that the type of field cells probably is not recognized in the python scope. Doing the assignment in a taichi kernel can circumvent the warning.
import taichi as ti
ti.init(arch=ti.gpu, offline_cache=False)
init = ti.field(ti.i8, shape=(2, 3))
# init[0, 0] = 1
# print(init)
@ti.kernel
def assign_a_cell():
init[0, 0] = ti.cast(1, ti.i8)
assign_a_cell()
print(init)
Maybe this issue can be closed. They have fixed this bug in version 1.7.2 (#8553).
Describe the bug When assigning a constant to a field cell, Taichi emits a warning about possible loss of precision even though it's possible to determine at compile time that this is not the case
To Reproduce
Log/Screenshots
Additional comments Maybe I can just disable this check and runtime warning? It has a performance impact as it's emitted each time I do such an assignment.