Open ezw2 opened 3 years ago
A = hcl.compute((10, 10), lambda x, y: x + y) B = A[0] B[3] = 50 hcl.print(A[0][3]) # prints 50
To avoid this, a copy must be explicitly created
A = hcl.compute((10, 10), lambda x, y: x + y) B = hcl.copy(A[0]) B[3] = 50 hcl.print(A[0][3]) # prints 3 hcl.print(B[3]) # prints 50
This could be confusing, so it might be more intuitive to automatically create a copy of the tensor in this example.
To avoid this, a copy must be explicitly created
This could be confusing, so it might be more intuitive to automatically create a copy of the tensor in this example.