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

### `thunder.torch.size(a, /, dim=None)` {#thunder.torch.size}

[\[source\]](https://github.com/Lightning-AI/lightning-thunder/blob/0.2.6/thunder/torch/__init__.py#L286-L289)

Return type:

[`int`](https://docs.python.org/3/builtins/functions.html#int "(in Python v3.15)") | [`Sequence`](https://docs.python.org/3/library/collections.abc.html#collections.abc.Sequence "(in Python v3.15)")\[[`int`](https://docs.python.org/3/builtins/functions.html#int "(in Python v3.15)")\]

Parameters:

*   **a** ([_TensorProxy_](/docs/thunder/core/generated/thunder.core.proxies.TensorProxy#thunder.core.proxies.TensorProxy "thunder.core.proxies.TensorProxy")) –
    
*   **dim** ([_Union_](https://docs.python.org/3/library/typing.html#typing.Union "(in Python v3.15)")_\[__None__,_ [_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)
