> For the complete documentation index, see [llms.txt](https://deeplearning4j.konduit.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://deeplearning4j.konduit.ai/en-1.0.0-beta7/nd4j.md).

# ND4J

- [Overview](https://deeplearning4j.konduit.ai/en-1.0.0-beta7/nd4j/overview.md): Architecture, INDArray interface, memory model, data types, and backend system for the ND4J tensor library
- [Quickstart](https://deeplearning4j.konduit.ai/en-1.0.0-beta7/nd4j/quickstart.md): Hands-on quickstart guide for ND4J — creating arrays, basic operations, indexing, and shape manipulation
- [Creating NDArrays](https://deeplearning4j.konduit.ai/en-1.0.0-beta7/nd4j/creating-ndarrays.md): All methods for creating INDArrays — factory methods, from Java arrays, random, combining, and typed creation
- [Indexing and Slicing](https://deeplearning4j.konduit.ai/en-1.0.0-beta7/nd4j/indexing-and-slicing.md): Accessing and modifying elements, rows, columns, and sub-arrays of INDArrays using NDArrayIndex
- [Operations](https://deeplearning4j.konduit.ai/en-1.0.0-beta7/nd4j/operations.md): Scalar, element-wise, transform, reduction, broadcast, comparison, and linear algebra operations on INDArrays
- [Matrix Manipulation](https://deeplearning4j.konduit.ai/en-1.0.0-beta7/nd4j/matrix-manipulation.md): Reshaping, transposing, permuting, concatenating, sorting, and other shape manipulation operations on INDArrays
- [Data Types](https://deeplearning4j.konduit.ai/en-1.0.0-beta7/nd4j/data-types.md): The DataType enum, per-array typing, type casting, mixed precision, and migration from global data type
- [Activations](https://deeplearning4j.konduit.ai/en-1.0.0-beta7/nd4j/activations.md): Activation functions in ND4J — the Activation enum, IActivation interface, mathematical definitions, and usage in layers
- [Updaters](https://deeplearning4j.konduit.ai/en-1.0.0-beta7/nd4j/updaters.md): Optimization algorithms in ND4J — Adam, SGD, AdaGrad, learning rate schedules, and per-layer updater configuration
- [Loss Functions](https://deeplearning4j.konduit.ai/en-1.0.0-beta7/nd4j/loss-functions.md): All loss functions in ND4J — ILossFunction implementations, usage in output layers, weighted loss, and custom loss functions
- [Weight Initialization](https://deeplearning4j.konduit.ai/en-1.0.0-beta7/nd4j/weight-initialization.md): Weight initialization strategies in ND4J — WeightInit enum, IWeightInit interface, and choosing the right initializer
- [Serialization](https://deeplearning4j.konduit.ai/en-1.0.0-beta7/nd4j/serialization.md): Saving and loading INDArrays in binary, text, NumPy, and ByteBuffer formats
- [Workspaces](https://deeplearning4j.konduit.ai/en-1.0.0-beta7/nd4j/workspaces.md): MemoryWorkspace API — configuration, policies, nested workspaces, scope panic, and lifecycle management
- [Random Number Generation](https://deeplearning4j.konduit.ai/en-1.0.0-beta7/nd4j/random.md): Generating random INDArrays, probability distributions, seeding, and reproducibility in ND4J
- [New Operations Reference](https://deeplearning4j.konduit.ai/en-1.0.0-beta7/nd4j/new-operations.md): Complete reference for ~130 new native operations — fused attention, KV cache, PEFT linear layers, normalization, positional encoding, quantization, SSM, MoE, and audio/signal processing
- [Backends](https://deeplearning4j.konduit.ai/en-1.0.0-beta7/nd4j/overview-1.md): How ND4J's backend system works — SPI mechanism, backend selection, and the relationship between nd4j-native and nd4j-cuda
- [CPU (nd4j-native)](https://deeplearning4j.konduit.ai/en-1.0.0-beta7/nd4j/overview-1/cpu.md): Setting up the nd4j-native CPU backend — Maven dependencies, AVX2/AVX512 optimizations, OpenBLAS, MKL, and multi-threading
- [CUDA (nd4j-cuda)](https://deeplearning4j.konduit.ai/en-1.0.0-beta7/nd4j/overview-1/cuda.md): Setting up the nd4j-cuda GPU backend — CUDA versions, cuDNN integration, multi-GPU, and GPU memory management
- [Hardware Backends (1.0.0-rewrite)](https://deeplearning4j.konduit.ai/en-1.0.0-beta7/nd4j/overview-1/hardware-backends.md): GPU, TPU, DSP, and CPU acceleration backends — CUDA, TPU (PJRT), Hexagon (QNN), ZLUDA, ARM ACL, Apple Accelerate, cuDNN, MPS, MLIR, and multi-backend dispatch
- [SameDiff](https://deeplearning4j.konduit.ai/en-1.0.0-beta7/nd4j/overview-2.md): Automatic differentiation framework in ND4J — define-and-run computation graphs, comparison with MultiLayerNetwork and ComputationGraph
- [Variables](https://deeplearning4j.konduit.ai/en-1.0.0-beta7/nd4j/overview-2/variables.md): SDVariable types — VARIABLE, CONSTANT, PLACEHOLDER, ARRAY — data types, naming, and type conversion
- [Operations](https://deeplearning4j.konduit.ai/en-1.0.0-beta7/nd4j/overview-2/operations.md): Op namespaces — sd.math, sd.nn, sd.cnn, sd.rnn, sd.loss, sd.random — and SDVariable methods
- [Training](https://deeplearning4j.konduit.ai/en-1.0.0-beta7/nd4j/overview-2/training.md): Training SameDiff models — TrainingConfig, fit(), listeners, loss curves, and evaluation
- [Execution and Inference](https://deeplearning4j.konduit.ai/en-1.0.0-beta7/nd4j/overview-2/execution.md): Running SameDiff graphs — exec(), output(), batchOutput(), placeholders, and InferenceSession
- [Serialization](https://deeplearning4j.konduit.ai/en-1.0.0-beta7/nd4j/overview-2/serialization.md): Saving and loading SameDiff graphs in FlatBuffers format
- [DSP Execution Engine](https://deeplearning4j.konduit.ai/en-1.0.0-beta7/nd4j/overview-2/dsp.md): Complete guide to the Dynamic Shape Plan execution engine — compiled graph runtime with CUDA graph capture/replay, Triton/NVRTC/PTX JIT, 26-pass optimizer, and multi-backend dispatch


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://deeplearning4j.konduit.ai/en-1.0.0-beta7/nd4j.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
