---
title: "batchNorm(mean:variance:weight:bias:epsilon:)"
framework: accelerate
role: symbol
role_heading: Instance Method
path: "accelerate/bnnsgraph/builder/tensor/batchnorm(mean:variance:weight:bias:epsilon:)"
---

# batchNorm(mean:variance:weight:bias:epsilon:)

Adds a batch normalization operation to the current graph.

## Declaration

```swift
func batchNorm(mean: some BNNSGraph.Builder.OperationParameter<T>, variance: some BNNSGraph.Builder.OperationParameter<T>, weight: some BNNSGraph.Builder.OperationParameter<T>, bias: some BNNSGraph.Builder.OperationParameter<T>, epsilon: Float = .ulpOfOne.squareRoot()) -> BNNSGraph.Builder.Tensor<T>
```

## Parameters

- `mean`: The precomputed mean values.
- `variance`: The precomputed variances.
- `weight`: The weight values.
- `bias`: The bias values.
- `epsilon`: The epsilon value that the function uses to avoid division by zero.
