-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
to_numpy() broken on macos 12.6 and vulkan #6217
Comments
The methods import taichi as ti
import numpy as np
import torch
ti.init(arch=ti.vulkan)
a = ti.field(dtype=ti.f32, shape=(10,))
float32 = torch.ones(10, dtype=torch.float32)
print("float32: ", float32)
a.from_torch(float32)
for i in range(10):
print("a: ", a[i])
@ti.kernel
def from_numpy(dst: ti.template(), src: ti.types.ndarray()):
for I in ti.grouped(src):
dst[I] = src[I]
def from_numpy_python(dst, src):
for i in range(dst.shape[0]):
dst[i] = src[i]
float32 = np.array([1.0]*10).astype(np.float32)
from_numpy(a, float32)
for i in range(10):
print("a: ", a[i])
from_numpy_python(a, float32)
for i in range(10):
print("a: ", a[i]) |
Sounds like an synchronization issue... Can you try to add a |
I have tried |
I'll close this issue because #6295 is essentially talking about the same problem and we'll update our progress there. |
to_numpy() broken after upgrade to macos 12.6, on M1 chip
prints x.to_numpy() as [0, 0, 0, ..., 0]
The text was updated successfully, but these errors were encountered: