# 从这里开始！

请使用下方的交互工具，帮助你开始学习 Accelerate 的特定功能及其使用方法！该工具将为你提供代码差异、对正在发生的事情的解释，以及一些有用的链接，以便你在文档中进一步探索！

大多数代码示例都从以下 Python 代码开始，然后以某种方式集成 Accelerate：

```python
for batch in dataloader:
    optimizer.zero_grad()
    inputs, targets = batch
    inputs = inputs.to(device)
    targets = targets.to(device)
    outputs = model(inputs)
    loss = loss_function(outputs, targets)
    loss.backward()
    optimizer.step()
    scheduler.step()
```

	<iframe src="https://hf-accelerate-accelerate-examples.hf.space?__theme=light" width="850" height="1600"
    >

    <iframe src="https://hf-accelerate-accelerate-examples.hf.space?__theme=dark" width="850" height="1600"
    >

