Skip to content

Commit 5a63864

Browse files
committed
fix: #2973
1 parent 181c903 commit 5a63864

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

python/taichi/lang/field.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,8 @@ def __getitem__(self, key):
187187
def __str__(self):
188188
if impl.inside_kernel():
189189
return self.__repr__() # make pybind11 happy, see Matrix.__str__
190+
if self.snode.ptr is None:
191+
return '<Field: Definition of this field is incomplete>'
190192
else:
191193
return str(self.to_numpy())
192194

0 commit comments

Comments
 (0)