# peft

[[[Source]]](https://github.com/google-deepmind/gemma/tree/main/gemma/peft/__init__.py)

```{code-block}
from gemma import peft
```

```{eval-rst}
.. automodule:: gemma.peft
  :no-members:
```

## All symbols


### Module

|  |  |
--- | ---
[peft](index) | PEFT utils for `flax.linen`.

### Class

|  |  |
--- | ---
[peft.IntDense](IntDense) | Wrapper around `nn.Dense` which adds a Quantized adapter.
[peft.IntEinsum](IntEinsum) | Wrapper around `nn.Einsum` which adds a Quantized adapter.
[peft.Interceptor](Interceptor) | Base class for interceptors.
[peft.LoRADense](LoRADense) | Wrapper around `nn.Dense` which adds a LoRA adapter.
[peft.LoRADenseAdapter](LoRADenseAdapter) | LoRA module.
[peft.LoRADenseGeneral](LoRADenseGeneral) | Wrapper around `nn.DenseGeneral` which adds a LoRA adapter.
[peft.LoRADenseGeneralAdapter](LoRADenseGeneralAdapter) | LoRA general dense module.
[peft.LoRAEinsum](LoRAEinsum) | Wrapper around `nn.Einsum` which adds a LoRA adapter.
[peft.LoRAEinsumAdapter](LoRAEinsumAdapter) | LoRA einsum module.
[peft.ModuleInterceptor](ModuleInterceptor) | Interceptor that capture all modules to eventually replaces them.
[peft.QuantizationMethod](QuantizationMethod) | Quantization methods.
[peft.SimulateQuantizedDense](SimulateQuantizedDense) | Wrapper around `nn.Dense` which adds a Quantized adapter.
[peft.SimulateQuantizedEinsum](SimulateQuantizedEinsum) | Wrapper around `nn.Einsum` which adds a Quantized adapter.

### Function

|  |  |
--- | ---
[peft.fuse_params](fuse_params) | 
[peft.get_axis_to_reduce_from_einsum_str](get_axis_to_reduce_from_einsum_str) | Returns the axis to reduce over.
[peft.merge_params](merge_params) | Inverse of `split_params`.
[peft.quantize](quantize) | Quantizes the given params.
[peft.simulate_quantize](simulate_quantize) | Quantizes the given array.
[peft.split_params](split_params) | Split a nested tree into 2 trees, one with and without 'lora' branches.
[peft.unfuse_params](unfuse_params) | 


```{toctree}
:hidden:

IntDense
IntEinsum
Interceptor
LoRADense
LoRADenseAdapter
LoRADenseGeneral
LoRADenseGeneralAdapter
LoRAEinsum
LoRAEinsumAdapter
ModuleInterceptor
QuantizationMethod
SimulateQuantizedDense
SimulateQuantizedEinsum
fuse_params
get_axis_to_reduce_from_einsum_str
merge_params
quantize
simulate_quantize
split_params
unfuse_params
```