# Usage of Tullio.jl

**URL:** https://discourse.julialang.org/t/usage-of-tullio-jl/126908
**Category:** General Usage
**Tags:** question, tullio
**Created:** [March 13, 2025, 10:59am UTC](https://discourse.julialang.org/t/usage-of-tullio-jl/126908 "2025-03-13T10:59:45Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![hssn15](https://avatars.discourse-cdn.com/v4/letter/h/8797f3/32.png) [@hssn15](https://discourse.julialang.org/u/hssn15)
#### Post date: [March 13, 2025, 10:59am UTC](https://discourse.julialang.org/t/usage-of-tullio-jl/126908/1 "2025-03-13T10:59:45Z")

</div>

I have a really big code, that is separated into bunch of functions, modules, and files. I would like to implement Tullio.jl to optimize loops and array operations. Normally I’m using @tullio macro before the loop or arrray operations. Since the code is really big, I would like to know if there’s any way to apply it to whole code.

---

<div class="post-metadata">

### Author: ![mcabbott](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mcabbott/32/6603_2.png) [@mcabbott](https://discourse.julialang.org/u/mcabbott)
#### Post date: [March 13, 2025, 3:37pm UTC](https://discourse.julialang.org/t/usage-of-tullio-jl/126908/2 "2025-03-13T15:37:49Z")

</div>

TensorOperations.jl does allow its macro to act on a code block, and look for all applicable expressions within. I think that’s what you’re asking for:

```julia
@tensor begin
    # all expressions like this are transformed:
    D[a, b, c] = ...
    E[a, b, c] := ...
end

```

But Tullio.jl doesn’t support this. The macro expects one assignment expression, something like `@tullio out[i] := ...`, and always writes one set of nested loops.
