Skip to content
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

Bug report with slicing of ArrayXf #284

Open
XiaoXinyyx opened this issue Sep 21, 2024 · 1 comment
Open

Bug report with slicing of ArrayXf #284

XiaoXinyyx opened this issue Sep 21, 2024 · 1 comment

Comments

@XiaoXinyyx
Copy link

XiaoXinyyx commented Sep 21, 2024

Read and Write inconsistency :

import drjit as dr
a = dr.cuda.ad.ArrayXf([1,2,3],[4,5,6])
a
# [[1.0, 4.0],
#  [2.0, 5.0],
#  [3.0, 6.0]]

a[:,0]
#[1.0, 2.0, 3.0]

a[:,0] = 10
# [[10.0, 10.0],
#  [2.0, 5.0],
#  [3.0, 6.0]]
@wjakob
Copy link
Member

wjakob commented Sep 28, 2024

Array* types don't support the general slicing protocols and generally cannot be used like tensors. What you need to use is some form of TensorX*. That said, I think that this should fail with a proper error message.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants