You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/src/darray.md
+72Lines changed: 72 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -211,6 +211,78 @@ across the workers in the Julia cluster in a relatively even distribution;
211
211
future operations on a `DArray` may produce a different distribution from the
212
212
one chosen by previous calls.
213
213
214
+
### DArray Chunk Slicing with `view`
215
+
216
+
Dagger's `view` function allows you to efficiently create a "view" of a `DArray`'s `Chunk` or a `DTask` that produces a `DArray``Chunk`. This enables operations on specific parts of your distributed data using standard Julia array slicing, without needing to materialize the entire chunk.
These methods create a `view` for a `DArray``Chunk` object or for a `DTask` that will produce a `DArray``Chunk`. You specify the desired sub-region using standard Julia array slicing syntax, identical to how you would slice a regular Array.
221
+
222
+
#### Examples
223
+
224
+
```julia
225
+
julia> A = rand(64, 64)
226
+
64×64 Matrix{Float64}:
227
+
[...]
228
+
229
+
julia> DA = DArray(A, Blocks(8,8))
230
+
64x64 DMatrix{Float64} with 8x8 partitions of size 8x8:
231
+
[...]
232
+
233
+
julia> chunk = DA.chunks[1,1]
234
+
DTask (finished)
235
+
236
+
julia> view(chunk, :, :) # View the entire 8x8 chunk
0 commit comments