# What are the different PyTorch op decompositions?

**URL:** <https://dev-discuss.pytorch.org/t/what-are-the-different-pytorch-op-decompositions/2142>\
**Category:** Uncategorized\
**Created:** [June 5, 2024, 1:23pm UTC](https://dev-discuss.pytorch.org/t/what-are-the-different-pytorch-op-decompositions/2142 "2024-06-05T13:23:41Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![teraba](https://avatars.discourse-cdn.com/v4/letter/t/b19c9b/32.png) [@teraba](https://dev-discuss.pytorch.org/u/teraba)\
**Post date:** [June 5, 2024, 1:23pm UTC](https://dev-discuss.pytorch.org/t/what-are-the-different-pytorch-op-decompositions/2142/1 "2024-06-05T13:23:41Z")

</div>

I see multiple op decompositions defined in PyTorch:

- torch/\_decomp/decompositions.py
- torch/\_inductor/decomposition.py
- torch/jit/\_decompositions.py

Few questions over this:

- What is the scope of these decomposition types?
- Does these decomposition take place in all 3 modes in PyTorch (eager, compile and lazy)?
- Are there any limitation in decomposing an op? like is the schema of the op updated if I use a custom decomposition to decompose it to a variant of the same op? (the variant may be a custom op or a non-core Aten op)
