---
title: thunder.clang.diagonal
canonical: >-
  https://lightning.ai/docs/thunder/stable/api-reference/generated/thunder.clang.diagonal
---
# thunder.clang.diagonal {#thunder-clang-diagonal}

### `thunder.clang.diagonal(a, offset=0, dim1=0, dim2=1)` {#thunder.clang.diagonal}

[\[source\]](https://github.com/Lightning-AI/lightning-thunder/blob/0.2.6/thunder/core/langctxs.py#L352-L367)

Return type:

[`TensorProxy`](/docs/thunder/core/generated/thunder.core.proxies.TensorProxy#thunder.core.proxies.TensorProxy "thunder.core.proxies.TensorProxy")

Parameters:

*   **a** ([_TensorProxy_](/docs/thunder/core/generated/thunder.core.proxies.TensorProxy#thunder.core.proxies.TensorProxy "thunder.core.proxies.TensorProxy")) –
    
*   **offset** ([_int_](https://docs.python.org/3/builtins/functions.html#int "(in Python v3.15)")) –
    
*   **dim1** ([_int_](https://docs.python.org/3/builtins/functions.html#int "(in Python v3.15)")) –
    
*   **dim2** ([_int_](https://docs.python.org/3/builtins/functions.html#int "(in Python v3.15)")) –

---

**Navigation**

- Parent: [Generated](/docs/thunder/0.2.6/api-reference/generated.md)
