File tree Expand file tree Collapse file tree 1 file changed +16
-5
lines changed
Expand file tree Collapse file tree 1 file changed +16
-5
lines changed Original file line number Diff line number Diff line change @@ -181,6 +181,22 @@ original-tensor
181181; ;
182182; ; Let's explore essential tensor operations for transforming and converting data.
183183
184+ ; ; ## The tensor Namespace
185+
186+ (require '[tech.v3.tensor :as tensor])
187+
188+ ; ; The [`tech.v3.tensor`](https://cnuernber.github.io/dtype-next/tech.v3.tensor.html)
189+ ; ; namespace provides multi-dimensional array operations—the core of working with
190+ ; ; tensors in dtype-next.
191+ ; ;
192+ ; ; **Key functions we'll use:**
193+ ; ; - `tensor/compute-tensor` — create tensors by applying a function to each position
194+ ; ; - `tensor/select` — extract regions (zero-copy slicing)
195+ ; ; - `tensor/slice` / `tensor/slice-right` — iterate through dimensions
196+ ; ; - `tensor/reshape` — reinterpret shape without copying
197+ ; ; - `tensor/transpose` — reorder dimensions
198+ ; ; - `tensor/reduce-axis` — collapse dimensions with aggregation
199+
184200; ; ## Reshaping
185201
186202; ; Sometimes it's convenient to flatten spatial dimensions into a single axis.
@@ -244,11 +260,6 @@ original-tensor
244260
245261; ; ## Creating Tensors: tensor/compute-tensor
246262
247- (require '[tech.v3.tensor :as tensor])
248-
249- ; ; The [`tech.v3.tensor`](https://cnuernber.github.io/dtype-next/tech.v3.tensor.html)
250- ; ; namespace provides multi-dimensional array operations.
251-
252263; ; `tensor/compute-tensor` creates a tensor by calling a function for each position.
253264; ; The function receives indices and returns the value for that position.
254265
You can’t perform that action at this time.
0 commit comments