Skip to content

Commit

Permalink
Update advanced_FAQs.md
Browse files Browse the repository at this point in the history
  • Loading branch information
EmilyWebber authored Jan 27, 2025
1 parent 3c3af84 commit 6f1489d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion contributed/advanced_FAQs.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
When you want to create a completely new variable, such as loading data directly using `nl.load()` without a predefined buffer, or computing some mathematical function as the result of multiple tiles to create a new tile, then you can use `foo = nl.load()` or `bar = tile_a + tile_b`.

However, sometimes you simply want to work with the data or physical address stored by reference through that variable. This is the case at least twice in examples you've seen.
1. When you create a buffer on chip, such as with `a_tile = nl.ndarray()`. You can then use `a_tile[...] = nl.load()` to load directly onto that tile.
1. When you create a buffer on chip, such as with `a_tile = nl.ndarray( etc, buffer = nl.sbuf)`. You can then use `a_tile[...] = nl.load()` to load directly onto that tile.
2. When you are performing computation on tiles through indexing, and you want that same indexing logic to carry into the position where your resultant data is stored. This is the case for `a_tile[...] = nl.load(a_vec[m * ROW_CHUNK : (m + 1) * ROW_CHUNK])`.

Generally we use the `var[...]` syntax to let you alter the data represented by your variable without you needing to define a new one.
Expand Down

0 comments on commit 6f1489d

Please sign in to comment.