---
title: "Forward Pass"
canonical: "https://www.thundercompute.com/glossary/training/forward-pass"
description: "Computing the output of a neural network from input to prediction"
sidebarTitle: "Forward Pass"
icon: "arrow-right"
iconType: "solid"
---

A **forward pass** is the process of feeding input data through a neural network layer by layer to produce an output (prediction). Each layer applies its weights and activation functions in sequence.

## Example

```python
import torch
import torch.nn as nn

model = nn.Sequential(
    nn.Linear(784, 256),
    nn.ReLU(),
    nn.Linear(256, 10),
)
model = model.cuda()

x = torch.randn(32, 784, device="cuda")  # batch of 32
output = model(x)                          # forward pass → shape [32, 10]
```

## Key Points

- Computes predictions from input data
- Each layer's intermediate outputs are called **activations**
- Activations are stored in memory during training (needed for backpropagation)

## See Also

- [Backpropagation](/training/backpropagation)
- [Batch Size](/training/batch-size)
