-
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
Modify in place a slice of numpy array #8493
Labels
question
Question on using Taichi
Comments
FrankFrank9
changed the title
Access and pass a slice of an array
Modify in place a slice of numpy array
Mar 21, 2024
Sorry I can't fully understand your meaning yet, so are those my following comment match what you means? Variable @ti.kernel
def foo(upts: ti.types.ndarray()):
for i in range(10):
upts_ = ti.Vector([0.0 for _ in range(3)], dt=ti.f64)
taich_fun(upts_)
for j in range(3):
upts[j, i] = upts_[j] And the result I run in Taichi v1.6.0 is:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello,
I'm facing an issue where I can't modify an underlying numpy array from taichi. I would like to modify upts directly but in my original code I need to access a slice of it namely the values allocated in upts_. Here is a MWE of what I'm trying to achieve
Do you have any idea on how to work around this?
The text was updated successfully, but these errors were encountered: