> For the complete documentation index, see [llms.txt](https://docs.fairmath.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.fairmath.xyz/fhe-computer/isa/tensor.md).

# tensor

The `tensor` dialect supports operations on multidimensional arrays, commonly used in machine learning and linear algebra computations. While the initial implementation is flat, future versions may include subgroups for specialized tensor operations (e.g., sparse tensors).

### Examples

{% code overflow="wrap" %}

```
//Creates a 1-dimensional tensor of size 
%tensor = tensor.create %shape : (i32) -> tensor<[n]> 

// Performs element-wise addition on two 4x4 tensors.
%result = tensor.add %t1, %t2 : (tensor<[4]x[4]>, tensor<[4]x[4]>) -> tensor<[4]x[4]>
```

{% endcode %}

```
```
