Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Start here

This is the recommended learning path for matten.

Numeric tensors

If your data is already clean numeric values, follow these examples in order:

StepExampleWhat you learn
1cargo run --example 00_quickstartCreate, add, reshape
2cargo run --example 01_create_tensorAll construction APIs
3cargo run --example 02_shape_and_sizeShape inspection
4cargo run --example 04_elementwise_opsElement-wise arithmetic
5cargo run --example 06_broadcastingNumPy-style broadcasting
6cargo run --example 08_slicing_builderSlice builder API
7cargo run --example 22_matrix_multiplicationdot / matmul
8cargo run --example 27_axis_reductionsRow/column reductions
9cargo run --example 12_boundary_error_handlingSafe error handling

After these nine examples you understand the numeric core.

Dynamic ingestion: messy data with dynamic

If your input has missing values, mixed types, or dirty CSV/JSON:

StepExampleWhat you learn
1cargo run --example dynamic_00_quickstart --features dynamic,json,csvDynamic lifecycle
2cargo run --example dynamic_02_missing_values --features dynamic,csvMissing values
3cargo run --example dynamic_05_dirty_csv_cleanup --features dynamic,csvDirty CSV
4cargo run --example dynamic_07_on_ramp_summary --features dynamicFull on-ramp
5cargo run --example dynamic_06_numeric_policy --features dynamicConversion policy

The lifecycle rule

Always follow this pattern with dynamic data:

messy input
  → ingest as dynamic tensor    (from_json_dynamic / from_csv_dynamic)
  → inspect                     (schema_summary, numeric_mask, count_none)
  → clean                       (fill_none, forward_fill_none)
  → convert                     (try_numeric / try_numeric_with)
  → numeric tensor computation  (&a + &b, matmul, sum_axis, …)

Never call arithmetic, reductions, or slicing on a dynamic tensor directly — those APIs reject dynamic tensors with a clear message directing you to try_numeric() first.

When to graduate from matten

matten is the family car: easy to start, honest about its limits. When you need performance, static shapes, or advanced linear algebra, see Migration to specialised libraries.