Repository: lf1-io/padl (language: python)

Issue:
Fix test for Try
@eramdiaz These changes will allow your tests to pass. I realize that this does not resolve the issue of saving a Transform that has been defined as an attribute of a class, but that can be resolved in a different PR from this one I think. What do you think?



Discussion / hints:

Fix patch:
diff --git a/docs/src/usage.md b/docs/src/usage.md
index 53df731e..42ac99b7 100644
--- a/docs/src/usage.md
+++ b/docs/src/usage.md
@@ -16,6 +16,7 @@ usage/apply.md
 usage/saving.md
 usage/print_slice.md
 usage/pytorch.md
+usage/debugging_your_transforms.md
 usage/extras.md
 ```
 
@@ -34,4 +35,5 @@ usage/extras.md
 - {class}`~padl.IfInfer` for conditioning on the 'infer'-stage.
 - {class}`~padl.IfEval` for conditioning on the 'eval'-stage.
 - {class}`~padl.IfTrain` for conditioning on the 'train'-stage.
-- {class}`~padl.Try` for catching exceptions in a transform.
+- {class}`~padl.Try` for catching exceptions in a Transform.
+- {class}`~padl.utils.pd_debug` for debugging Transforms.
diff --git a/docs/src/usage/debugging_your_transforms.md b/docs/src/usage/debugging_your_transforms.md
new file mode 100644
index 00000000..4302b021
--- /dev/null
+++ b/docs/src/usage/debugging_your_transforms.md
@@ -0,0 +1,124 @@
+(debugging-your-transforms)=
+## Debugging your Transforms
+
+PADL provides a customized debugger to inspect and diagnose errors raised when applying a 
+{class}`~padl.transforms.Pipeline`.
+
+For using this functionality, call {obj}`~padl.pd_debug` after the execution failed, such as 
+
+```python
+# train_apply, eval_apply or infer_apply that produced a RuntimeError
+
+from padl import pd_debug
+
+pd_debug()
+```
+
+This way, we get a debugger where we can interact with the different parts of the 
+{class}`~padl.transforms.Pipeline` and inspect relevant information on each level.
+
+The debugger console has defined the following commands:
+```
+* u(p): go one abstraction level up on the {class}`~padl.transforms.Pipeline`.
+* d(own): go one abstraction level down on the {class}`~padl.transforms.Pipeline`.
+* w(here am I?): show code position where the {class}`~padl.transforms.Transform` was defined.
+* i(nput): show input to this level.
+* r(epeat): repeat the execution from here (it will produce the same Exception).
+* t(ransform): display the current Transform.
+* h(elp): print help about the commands.
+* q(uit): quit the debugger.
+```
+
+On top of this, it incorporates an in-line co:mpiler so the user can define and inspect variables, 
+check attributes, import packages...
+
+### Example
+
+Let `t` be the following {class}`~padl.transforms.Pipeline`.
+
+```python
+import torch
+from padl import transform, batch
+
+to_tensor = transform(lambda x: torch.LongTensor(x))
+emb = transform(torch.nn.Embedding)(10, 8)
+linear =  transform(torch.nn.Linear)(5, 5)
+t = to_tensor >> batch >> emb >> linear
+```
+
+Then, if we run
+
+```python
+list(t.train_apply([[9,8,8], [4, 4, 4], [5, 5, 5], [6, 6, 6]], batch_size=2, num_workers=0))
+```
+
+we get an error since the shape of the embeddings does not match with the one expected by the linear
+layer. Calling {obj}`~padl.pd_debug` after this will retrieve a console where we can make some checks. 
+
+At the starting level of the debugger, we interact with the entire Transform and its absolute 
+input. When going down one level by entering `d` , the debugger switches to the 
+{ref} stage <stages> that got the Exception (*preprocess*, 
+*forward* or *postprocess*), and each level deeper moves recursively inside the element that failed
+until the {class}`~padl.transforms.AtomicTransform` that failed is reached.
+
+Below, some commands and statements are shown:
+
+```python
+> i
+
+[[9, 8, 8], [4, 4, 4]]
+
+> t
+
+Compose - "t":
+
+      │
+      ▼ x
+   0: lambda x: torch.LongTensor(x)                
+      │
+      ▼ args
+   1: Batchify(dim=0)                              
+      │
+      ▼ input
+   2: Embedding(num_embeddings=10, embedding_dim=8)
+      │
+      ▼ input
+   3: Linear(in_features=5, out_features=5)          <---- error here 
+
+> w
+    
+----> 7    t = to_tensor >> batch >> emb >> linear
+
+> d
+
+Compose:
+
+      │
+      ▼ input
+   0: Embedding(num_embeddings=10, embedding_dim=8)
+      │
+      ▼ input
+   1: Linear(in_features=5, out_features=5)          <---- error here 
+
+> d
+
+Linear(in_features=5, out_features=5) - "linear":
+
+   Linear(in_features=5, out_features=5, bias=True)  <---- error here 
+
+> w
+
+----> 6    linear = transform(torch.nn.Linear)(5, 5)
+
+> i.shape
+
+torch.Size([2, 3, 8])
+
+> a = 4
+> a + 1
+
+5
+
+> q
+```
+
diff --git a/docs/unstable/README.html b/docs/unstable/README.html
index 4fa09ea4..a4df2bc8 100644
--- a/docs/unstable/README.html
+++ b/docs/unstable/README.html
@@ -95,6 +95,10 @@
 <li class="toctree-l3"><a class="reference internal" href="usage/pytorch.html#weight-sharing">Weight Sharing</a></li>
 </ul>
 </li>
+<li class="toctree-l2"><a class="reference internal" href="usage/debugging_your_transforms.html">Debugging your Transforms</a><ul>
+<li class="toctree-l3"><a class="reference internal" href="usage/debugging_your_transforms.html#example">Example</a></li>
+</ul>
+</li>
 <li class="toctree-l2"><a class="reference internal" href="usage/extras.html">Extras</a><ul>
 <li class="toctree-l3"><a class="reference internal" href="usage/extras.html#the-same-utility">The <code class="xref py py-obj docutils literal notranslate"><span class="pre">same</span></code> Utility</a></li>
 <li class="toctree-l3"><a class="reference internal" href="usage/extras.html#applying-transforms-depending-on-the-mode">Applying Transforms Depending on the Mode</a></li>
diff --git a/docs/unstable/_sources/usage.md.txt b/docs/unstable/_sources/usage.md.txt
index 53df731e..42ac99b7 100644
--- a/docs/unstable/_sources/usage.md.txt
+++ b/docs/unstable/_sources/usage.md.txt
@@ -16,6 +16,7 @@ usage/apply.md
 usage/saving.md
 usage/print_slice.md
 usage/pytorch.md
+usage/debugging_your_transforms.md
 usage/extras.md
 ```
 
@@ -34,4 +35,5 @@ usage/extras.md
 - {class}`~padl.IfInfer` for conditioning on the 'infer'-stage.
 - {class}`~padl.IfEval` for conditioning on the 'eval'-stage.
 - {class}`~padl.IfTrain` for conditioning on the 'train'-stage.
-- {class}`~padl.Try` for catching exceptions in a transform.
+- {class}`~padl.Try` for catching exceptions in a Transform.
+- {class}`~padl.utils.pd_debug` for debugging Transforms.
diff --git a/docs/unstable/_sources/usage/debugging_your_transforms.md.txt b/docs/unstable/_sources/usage/debugging_your_transforms.md.txt
new file mode 100644
index 00000000..4302b021
--- /dev/null
+++ b/docs/unstable/_sources/usage/debugging_your_transforms.md.txt
@@ -0,0 +1,124 @@
+(debugging-your-transforms)=
+## Debugging your Transforms
+
+PADL provides a customized debugger to inspect and diagnose errors raised when applying a 
+{class}`~padl.transforms.Pipeline`.
+
+For using this functionality, call {obj}`~padl.pd_debug` after the execution failed, such as 
+
+```python
+# train_apply, eval_apply or infer_apply that produced a RuntimeError
+
+from padl import pd_debug
+
+pd_debug()
+```
+
+This way, we get a debugger where we can interact with the different parts of the 
+{class}`~padl.transforms.Pipeline` and inspect relevant information on each level.
+
+The debugger console has defined the following commands:
+```
+* u(p): go one abstraction level up on the {class}`~padl.transforms.Pipeline`.
+* d(own): go one abstraction level down on the {class}`~padl.transforms.Pipeline`.
+* w(here am I?): show code position where the {class}`~padl.transforms.Transform` was defined.
+* i(nput): show input to this level.
+* r(epeat): repeat the execution from here (it will produce the same Exception).
+* t(ransform): display the current Transform.
+* h(elp): print help about the commands.
+* q(uit): quit the debugger.
+```
+
+On top of this, it incorporates an in-line co:mpiler so the user can define and inspect variables, 
+check attributes, import packages...
+
+### Example
+
+Let `t` be the following {class}`~padl.transforms.Pipeline`.
+
+```python
+import torch
+from padl import transform, batch
+
+to_tensor = transform(lambda x: torch.LongTensor(x))
+emb = transform(torch.nn.Embedding)(10, 8)
+linear =  transform(torch.nn.Linear)(5, 5)
+t = to_tensor >> batch >> emb >> linear
+```
+
+Then, if we run
+
+```python
+list(t.train_apply([[9,8,8], [4, 4, 4], [5, 5, 5], [6, 6, 6]], batch_size=2, num_workers=0))
+```
+
+we get an error since the shape of the embeddings does not match with the one expected by the linear
+layer. Calling {obj}`~padl.pd_debug` after this will retrieve a console where we can make some checks. 
+
+At the starting level of the debugger, we interact with the entire Transform and its absolute 
+input. When going down one level by entering `d` , the debugger switches to the 
+{ref} stage <stages> that got the Exception (*preprocess*, 
+*forward* or *postprocess*), and each level deeper moves recursively inside the element that failed
+until the {class}`~padl.transforms.AtomicTransform` that failed is reached.
+
+Below, some commands and statements are shown:
+
+```python
+> i
+
+[[9, 8, 8], [4, 4, 4]]
+
+> t
+
+Compose - "t":
+
+      │
+      ▼ x
+   0: lambda x: torch.LongTensor(x)                
+      │
+      ▼ args
+   1: Batchify(dim=0)                              
+      │
+      ▼ input
+   2: Embedding(num_embeddings=10, embedding_dim=8)
+      │
+      ▼ input
+   3: Linear(in_features=5, out_features=5)          <---- error here 
+
+> w
+    
+----> 7    t = to_tensor >> batch >> emb >> linear
+
+> d
+
+Compose:
+
+      │
+      ▼ input
+   0: Embedding(num_embeddings=10, embedding_dim=8)
+      │
+      ▼ input
+   1: Linear(in_features=5, out_features=5)          <---- error here 
+
+> d
+
+Linear(in_features=5, out_features=5) - "linear":
+
+   Linear(in_features=5, out_features=5, bias=True)  <---- error here 
+
+> w
+
+----> 6    linear = transform(torch.nn.Linear)(5, 5)
+
+> i.shape
+
+torch.Size([2, 3, 8])
+
+> a = 4
+> a + 1
+
+5
+
+> q
+```
+
diff --git a/docs/unstable/advanced.html b/docs/unstable/advanced.html
index d0ca97ee..f299cadb 100644
--- a/docs/unstable/advanced.html
+++ b/docs/unstable/advanced.html
@@ -95,6 +95,10 @@
 <li class="toctree-l3"><a class="reference internal" href="usage/pytorch.html#weight-sharing">Weight Sharing</a></li>
 </ul>
 </li>
+<li class="toctree-l2"><a class="reference internal" href="usage/debugging_your_transforms.html">Debugging your Transforms</a><ul>
+<li class="toctree-l3"><a class="reference internal" href="usage/debugging_your_transforms.html#example">Example</a></li>
+</ul>
+</li>
 <li class="toctree-l2"><a class="reference internal" href="usage/extras.html">Extras</a><ul>
 <li class="toctree-l3"><a class="reference internal" href="usage/extras.html#the-same-utility">The <code class="xref py py-obj docutils literal notranslate"><span class="pre">same</span></code> Utility</a></li>
 <li class="toctree-l3"><a class="reference internal" href="usage/extras.html#applying-transforms-depending-on-the-mode">Applying Transforms Depending on the Mode</a></li>
diff --git a/docs/unstable/advanced/saving.html b/docs/unstable/advanced/saving.html
index d87ef9d5..7dd14fb2 100644
--- a/docs/unstable/advanced/saving.html
+++ b/docs/unstable/advanced/saving.html
@@ -95,6 +95,10 @@
 <li class="toctree-l3"><a class="reference internal" href="../usage/pytorch.html#weight-sharing">Weight Sharing</a></li>
 </ul>
 </li>
+<li class="toctree-l2"><a class="reference internal" href="../usage/debugging_your_transforms.html">Debugging your Transforms</a><ul>
+<li class="toctree-l3"><a class="reference internal" href="../usage/debugging_your_transforms.html#example">Example</a></li>
+</ul>
+</li>
 <li class="toctree-l2"><a class="reference internal" href="../usage/extras.html">Extras</a><ul>
 <li class="toctree-l3"><a class="reference internal" href="../usage/extras.html#the-same-utility">The <code class="xref py py-obj docutils literal notranslate"><span class="pre">same</span></code> Utility</a></li>
 <li class="toctree-l3"><a class="reference internal" href="../usage/extras.html#applying-transforms-depending-on-the-mode">Applying Transforms Depending on the Mode</a></li>
diff --git a/docs/unstable/apidocs/padl.dumptools.ast_utils.html b/docs/unstable/apidocs/padl.dumptools.ast_utils.html
index fc31ae42..92f8abe9 100644
--- a/docs/unstable/apidocs/padl.dumptools.ast_utils.html
+++ b/docs/unstable/apidocs/padl.dumptools.ast_utils.html
@@ -95,6 +95,10 @@
 <li class="toctree-l3"><a class="reference internal" href="../usage/pytorch.html#weight-sharing">Weight Sharing</a></li>
 </ul>
 </li>
+<li class="toctree-l2"><a class="reference internal" href="../usage/debugging_your_transforms.html">Debugging your Transforms</a><ul>
+<li class="toctree-l3"><a class="reference internal" href="../usage/debugging_your_transforms.html#example">Example</a></li>
+</ul>
+</li>
 <li class="toctree-l2"><a class="reference internal" href="../usage/extras.html">Extras</a><ul>
 <li class="toctree-l3"><a class="reference internal" href="../usage/extras.html#the-same-utility">The <code class="xref py py-obj docutils literal notranslate"><span class="pre">same</span></code> Utility</a></li>
 <li class="toctree-l3"><a class="reference internal" href="../usage/extras.html#applying-transforms-depending-on-the-mode">Applying Transforms Depending on the Mode</a></li>
diff --git a/docs/unstable/apidocs/padl.dumptools.html b/docs/unstable/apidocs/padl.dumptools.html
index 215eae72..7af4b734 100644
--- a/docs/unstable/apidocs/padl.dumptools.html
+++ b/docs/unstable/apidocs/padl.dumptools.html
@@ -95,6 +95,10 @@
 <li class="toctree-l3"><a class="reference internal" href="../usage/pytorch.html#weight-sharing">Weight Sharing</a></li>
 </ul>
 </li>
+<li class="toctree-l2"><a class="reference internal" href="../usage/debugging_your_transforms.html">Debugging your Transforms</a><ul>
+<li class="toctree-l3"><a class="reference internal" href="../usage/debugging_your_transforms.html#example">Example</a></li>
+</ul>
+</li>
 <li class="toctree-l2"><a class="reference internal" href="../usage/extras.html">Extras</a><ul>
 <li class="toctree-l3"><a class="reference internal" href="../usage/extras.html#the-same-utility">The <code class="xref py py-obj docutils literal notranslate"><span class="pre">same</span></code> Utility</a></li>
 <li class="toctree-l3"><a class="reference internal" href="../usage/extras.html#applying-transforms-depending-on-the-mode">Applying Transforms Depending on the Mode</a></li>
diff --git a/docs/unstable/apidocs/padl.dumptools.inspector.html b/docs/unstable/apidocs/padl.dumptools.inspector.html
index 1286c03b..850fc220 100644
--- a/docs/unstable/apidocs/padl.dumptools.inspector.html
+++ b/docs/unstable/apidocs/padl.dumptools.inspector.html
@@ -95,6 +95,10 @@
 <li class="toctree-l3"><a class="reference internal" href="../usage/pytorch.html#weight-sharing">Weight Sharing</a></li>
 </ul>
 </li>
+<li class="toctree-l2"><a class="reference internal" href="../usage/debugging_your_transforms.html">Debugging your Transforms</a><ul>
+<li class="toctree-l3"><a class="reference internal" href="../usage/debugging_your_transforms.html#example">Example</a></li>
+</ul>
+</li>
 <li class="toctree-l2"><a class="reference internal" href="../usage/extras.html">Extras</a><ul>
 <li class="toctree-l3"><a class="reference internal" href="../usage/extras.html#the-same-utility">The <code class="xref py py-obj docutils literal notranslate"><span class="pre">same</span></code> Utility</a></li>
 <li class="toctree-l3"><a class="reference internal" href="../usage/extras.html#applying-transforms-depending-on-the-mode">Applying Transforms Depending on the Mode</a></li>
diff --git a/docs/unstable/apidocs/padl.dumptools.packagefinder.html b/docs/unstable/apidocs/padl.dumptools.packagefinder.html
index 668b8c92..d8d93a02 100644
--- a/docs/unstable/apidocs/padl.dumptools.packagefinder.html
+++ b/docs/unstable/apidocs/padl.dumptools.packagefinder.html
@@ -95,6 +95,10 @@
 <li class="toctree-l3"><a class="reference internal" href="../usage/pytorch.html#weight-sharing">Weight Sharing</a></li>
 </ul>
 </li>
+<li class="toctree-l2"><a class="reference internal" href="../usage/debugging_your_transforms.html">Debugging your Transforms</a><ul>
+<li class="toctree-l3"><a class="reference internal" href="../usage/debugging_your_transforms.html#example">Example</a></li>
+</ul>
+</li>
 <li class="toctree-l2"><a class="reference internal" href="../usage/extras.html">Extras</a><ul>
 <li class="toctree-l3"><a class="reference internal" href="../usage/extras.html#the-same-utility">The <code class="xref py py-obj docutils literal notranslate"><span class="pre">same</span></code> Utility</a></li>
 <li class="toctree-l3"><a class="reference internal" href="../usage/extras.html#applying-transforms-depending-on-the-mode">Applying Transforms Depending on the Mode</a></li>
diff --git a/docs/unstable/apidocs/padl.dumptools.serialize.html b/docs/unstable/apidocs/padl.dumptools.serialize.html
index 72db83b5..0a56a8a1 100644
--- a/docs/unstable/apidocs/padl.dumptools.serialize.html
+++ b/docs/unstable/apidocs/padl.dumptools.serialize.html
@@ -95,6 +95,10 @@
 <li class="toctree-l3"><a class="reference internal" href="../usage/pytorch.html#weight-sharing">Weight Sharing</a></li>
 </ul>
 </li>
+<li class="toctree-l2"><a class="reference internal" href="../usage/debugging_your_transforms.html">Debugging your Transforms</a><ul>
+<li class="toctree-l3"><a class="reference internal" href="../usage/debugging_your_transforms.html#example">Example</a></li>
+</ul>
+</li>
 <li class="toctree-l2"><a class="reference internal" href="../usage/extras.html">Extras</a><ul>
 <li class="toctree-l3"><a class="reference internal" href="../usage/extras.html#the-same-utility">The <code class="xref py py-obj docutils literal notranslate"><span class="pre">same</span></code> Utility</a></li>
 <li class="toctree-l3"><a class="reference internal" href="../usage/extras.html#applying-transforms-depending-on-the-mode">Applying Transforms Depending on the Mode</a></li>
diff --git a/docs/unstable/apidocs/padl.dumptools.sourceget.html b/docs/unstable/apidocs/padl.dumptools.sourceget.html
index 82cc23f7..5aafbd35 100644
--- a/docs/unstable/apidocs/padl.dumptools.sourceget.html
+++ b/docs/unstable/apidocs/padl.dumptools.sourceget.html
@@ -95,6 +95,10 @@
 <li class="toctree-l3"><a class="reference internal" href="../usage/pytorch.html#weight-sharing">Weight Sharing</a></li>
 </ul>
 </li>
+<li class="toctree-l2"><a class="reference internal" href="../usage/debugging_your_transforms.html">Debugging your Transforms</a><ul>
+<li class="toctree-l3"><a class="reference internal" href="../usage/debugging_your_transforms.html#example">Example</a></li>
+</ul>
+</li>
 <li class="toctree-l2"><a class="reference internal" href="../usage/extras.html">Extras</a><ul>
 <li class="toctree-l3"><a class="reference internal" href="../usage/extras.html#the-same-utility">The <code class="xref py py-obj docutils literal notranslate"><span class="pre">same</span></code> Utility</a></li>
 <li class="toctree-l3"><a class="reference internal" href="../usage/extras.html#applying-transforms-depending-on-the-mode">Applying Transforms Depending on the Mode</a></li>
diff --git a/docs/unstable/apidocs/padl.dumptools.symfinder.html b/docs/unstable/apidocs/padl.dumptools.symfinder.html
index 730ddb8e..c3f6719b 100644
--- a/docs/unstable/apidocs/padl.dumptools.symfinder.html
+++ b/docs/unstable/apidocs/padl.dumptools.symfinder.html
@@ -95,6 +95,10 @@
 <li class="toctree-l3"><a class="reference internal" href="../usage/pytorch.html#weight-sharing">Weight Sharing</a></li>
 </ul>
 </li>
+<li class="toctree-l2"><a class="reference internal" href="../usage/debugging_your_transforms.html">Debugging your Transforms</a><ul>
+<li class="toctree-l3"><a class="reference internal" href="../usage/debugging_your_transforms.html#example">Example</a></li>
+</ul>
+</li>
 <li class="toctree-l2"><a class="reference internal" href="../usage/extras.html">Extras</a><ul>
 <li class="toctree-l3"><a class="reference internal" href="../usage/extras.html#the-same-utility">The <code class="xref py py-obj docutils literal notranslate"><span class="pre">same</span></code> Utility</a></li>
 <li class="toctree-l3"><a class="reference internal" href="../usage/extras.html#applying-transforms-depending-on-the-mode">Applying Transforms Depending on the Mode</a></li>
diff --git a/docs/unstable/apidocs/padl.dumptools.var2mod.html b/docs/unstable/apidocs/padl.dumptools.var2mod.html
index d677fe3e..a1a168bd 100644
--- a/docs/unstable/apidocs/padl.dumptools.var2mod.html
+++ b/docs/unstable/apidocs/padl.dumptools.var2mod.html
@@ -95,6 +95,10 @@
 <li class="toctree-l3"><a class="reference internal" href="../usage/pytorch.html#weight-sharing">Weight Sharing</a></li>
 </ul>
 </li>
+<li class="toctree-l2"><a class="reference internal" href="../usage/debugging_your_transforms.html">Debugging your Transforms</a><ul>
+<li class="toctree-l3"><a class="reference internal" href="../usage/debugging_your_transforms.html#example">Example</a></li>
+</ul>
+</li>
 <li class="toctree-l2"><a class="reference internal" href="../usage/extras.html">Extras</a><ul>
 <li class="toctree-l3"><a class="reference internal" href="../usage/extras.html#the-same-utility">The <code class="xref py py-obj docutils literal notranslate"><span class="pre">same</span></code> Utility</a></li>
 <li class="toctree-l3"><a class="reference internal" href="../usage/extras.html#applying-transforms-depending-on-the-mode">Applying Transforms Depending on the Mode</a></li>
diff --git a/docs/unstable/apidocs/padl.exceptions.html b/docs/unstable/apidocs/padl.exceptions.html
index 51118273..2a79a988 100644
--- a/docs/unstable/apidocs/padl.exceptions.html
+++ b/docs/unstable/apidocs/padl.exceptions.html
@@ -95,6 +95,10 @@
 <li class="toctree-l3"><a class="reference internal" href="../usage/pytorch.html#weight-sharing">Weight Sharing</a></li>
 </ul>
 </li>
+<li class="toctree-l2"><a class="reference internal" href="../usage/debugging_your_transforms.html">Debugging your Transforms</a><ul>
+<li class="toctree-l3"><a class="reference internal" href="../usage/debugging_your_transforms.html#example">Example</a></li>
+</ul>
+</li>
 <li class="toctree-l2"><a class="reference internal" href="../usage/extras.html">Extras</a><ul>
 <li class="toctree-l3"><a class="reference internal" href="../usage/extras.html#the-same-utility">The <code class="xref py py-obj docutils literal notranslate"><span class="pre">same</span></code> Utility</a></li>
 <li class="toctree-l3"><a class="reference internal" href="../usage/extras.html#applying-transforms-depending-on-the-mode">Applying Transforms Depending on the Mode</a></li>
diff --git a/docs/unstable/apidocs/padl.html b/docs/unstable/apidocs/padl.html
index a4b7bd04..8081e600 100644
--- a/docs/unstable/apidocs/padl.html
+++ b/docs/unstable/apidocs/padl.html
@@ -95,6 +95,10 @@
 <li class="toctree-l3"><a class="reference internal" href="../usage/pytorch.html#weight-sharing">Weight Sharing</a></li>
 </ul>
 </li>
+<li class="toctree-l2"><a class="reference internal" href="../usage/debugging_your_transforms.html">Debugging your Transforms</a><ul>
+<li class="toctree-l3"><a class="reference internal" href="../usage/debugging_your_transforms.html#example">Example</a></li>
+</ul>
+</li>
 <li class="toctree-l2"><a class="reference internal" href="../usage/extras.html">Extras</a><ul>
 <li class="toctree-l3"><a class="reference internal" href="../usage/extras.html#the-same-utility">The <code class="xref py py-obj docutils literal notranslate"><span class="pre">same</span></code> Utility</a></li>
 <li class="toctree-l3"><a class="reference internal" href="../usage/extras.html#applying-transforms-depending-on-the-mode">Applying Transforms Depending on the Mode</a></li>
diff --git a/docs/unstable/apidocs/padl.print_utils.html b/docs/unstable/apidocs/padl.print_utils.html
index c0b6201a..6971ce95 100644
--- a/docs/unstable/apidocs/padl.print_utils.html
+++ b/docs/unstable/apidocs/padl.print_utils.html
@@ -95,6 +95,10 @@
 <li class="toctree-l3"><a class="reference internal" href="../usage/pytorch.html#weight-sharing">Weight Sharing</a></li>
 </ul>
 </li>
+<li class="toctree-l2"><a class="reference internal" href="../usage/debugging_your_transforms.html">Debugging your Transforms</a><ul>
+<li class="toctree-l3"><a class="reference internal" href="../usage/debugging_your_transforms.html#example">Example</a></li>
+</ul>
+</li>
 <li class="toctree-l2"><a class="reference internal" href="../usage/extras.html">Extras</a><ul>
 <li class="toctree-l3"><a class="reference internal" href="../usage/extras.html#the-same-utility">The <code class="xref py py-obj docutils literal notranslate"><span class="pre">same</span></code> Utility</a></li>
 <li class="toctree-l3"><a class="reference internal" href="../usage/extras.html#applying-transforms-depending-on-the-mode">Applying Transforms Depending on the Mode</a></li>
diff --git a/docs/unstable/apidocs/padl.transforms.html b/docs/unstable/apidocs/padl.transforms.html
index 1fb5ba9b..7e6c675b 100644
--- a/docs/unstable/apidocs/padl.transforms.html
+++ b/docs/unstable/apidocs/padl.transforms.html
@@ -95,6 +95,10 @@
 <li class="toctree-l3"><a class="reference internal" href="../usage/pytorch.html#weight-sharing">Weight Sharing</a></li>
 </ul>
 </li>
+<li class="toctree-l2"><a class="reference internal" href="../usage/debugging_your_transforms.html">Debugging your Transforms</a><ul>
+<li class="toctree-l3"><a class="reference internal" href="../usage/debugging_your_transforms.html#example">Example</a></li>
+</ul>
+</li>
 <li class="toctree-l2"><a class="reference internal" href="../usage/extras.html">Extras</a><ul>
 <li class="toctree-l3"><a class="reference internal" href="../usage/extras.html#the-same-utility">The <code class="xref py py-obj docutils literal notranslate"><span class="pre">same</span></code> Utility</a></li>
 <li class="toctree-l3"><a class="reference internal" href="../usage/extras.html#applying-transforms-depending-on-the-mode">Applying Transforms Depending on the Mode</a></li>
@@ -238,14 +242,14 @@
 <dt class="sig sig-object py" id="padl.transforms.Compose">
 <em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">padl.transforms.</span></span><span class="sig-name descname"><span class="pre">Compose</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">transforms</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Iterable</span><span class="p"><span class="pre">[</span></span><a class="reference internal" href="#padl.transforms.Transform" title="padl.transforms.Transform"><span class="pre">padl.transforms.Transform</span></a><span class="p"><span class="pre">]</span></span></span></em>, <em class="sig-param"><span class="n"><span class="pre">call_info</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><a class="reference internal" href="padl.dumptools.inspector.html#padl.dumptools.inspector.CallInfo" title="padl.dumptools.inspector.CallInfo"><span class="pre">padl.dumptools.inspector.CallInfo</span></a><span class="p"><span class="pre">]</span></span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">pd_name</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">str</span><span class="p"><span class="pre">]</span></span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">pd_group</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">bool</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">False</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#padl.transforms.Compose" title="Permalink to this definition"></a></dt>
 <dd><p>Apply series of transforms on input.</p>
-<p>Compose([t1, t2, t3])(x) = t3(t1(t2(x)))</p>
+<p>Compose([t1, t2, t3])(x) = t3(t2(t1(x)))</p>
 <dl class="field-list simple">
 <dt class="field-odd">Parameters</dt>
 <dd class="field-odd"><ul class="simple">
 <li><p><strong>transforms</strong> – List of transforms to compose.</p></li>
 <li><p><strong>call_info</strong> – A <cite>CallInfo</cite> object containing information about the how the transform was
 created (needed for saving).</p></li>
-<li><p><strong>pd_name</strong> – name of the Compose transform</p></li>
+<li><p><strong>pd_name</strong> – name of the Compose transform.</p></li>
 <li><p><strong>pd_group</strong> – If <em>True</em>, do not flatten this when used as child transform in a
 <cite>Pipeline</cite>.</p></li>
 </ul>
@@ -453,7 +457,7 @@
 <dd class="field-odd"><ul class="simple">
 <li><p><strong>call_info</strong> – A <cite>CallInfo</cite> object containing information about the how the transform was
 created (needed for saving).</p></li>
-<li><p><strong>pd_name</strong> – name of the transform</p></li>
+<li><p><strong>pd_name</strong> – name of the transform.</p></li>
 </ul>
 </dd>
 </dl>
@@ -529,7 +533,7 @@
 
 <dl class="py method">
 <dt class="sig sig-object py" id="padl.transforms.Transform.pd_get_loader">
-<em class="property"><span class="pre">static</span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">pd_get_loader</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">args</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">preprocess</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">mode</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">torch.utils.data.dataloader.DataLoader</span></span></span><a class="headerlink" href="#padl.transforms.Transform.pd_get_loader" title="Permalink to this definition"></a></dt>
+<span class="sig-name descname"><span class="pre">pd_get_loader</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">args</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">preprocess</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">mode</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">torch.utils.data.dataloader.DataLoader</span></span></span><a class="headerlink" href="#padl.transforms.Transform.pd_get_loader" title="Permalink to this definition"></a></dt>
 <dd><p>Get a pytorch data loader.</p>
 <dl class="field-list simple">
 <dt class="field-odd">Parameters</dt>
diff --git a/docs/unstable/apidocs/padl.util_transforms.html b/docs/unstable/apidocs/padl.util_transforms.html
index cc7d9bf2..0828df59 100644
--- a/docs/unstable/apidocs/padl.util_transforms.html
+++ b/docs/unstable/apidocs/padl.util_transforms.html
@@ -95,6 +95,10 @@
 <li class="toctree-l3"><a class="reference internal" href="../usage/pytorch.html#weight-sharing">Weight Sharing</a></li>
 </ul>
 </li>
+<li class="toctree-l2"><a class="reference internal" href="../usage/debugging_your_transforms.html">Debugging your Transforms</a><ul>
+<li class="toctree-l3"><a class="reference internal" href="../usage/debugging_your_transforms.html#example">Example</a></li>
+</ul>
+</li>
 <li class="toctree-l2"><a class="reference internal" href="../usage/extras.html">Extras</a><ul>
 <li class="toctree-l3"><a class="reference internal" href="../usage/extras.html#the-same-utility">The <code class="xref py py-obj docutils literal notranslate"><span class="pre">same</span></code> Utility</a></li>
 <li class="toctree-l3"><a class="reference internal" href="../usage/extras.html#applying-transforms-depending-on-the-mode">Applying Transforms Depending on the Mode</a></li>
diff --git a/docs/unstable/apidocs/padl.utils.html b/docs/unstable/apidocs/padl.utils.html
index b75e5fff..f48de43c 100644
--- a/docs/unstable/apidocs/padl.utils.html
+++ b/docs/unstable/apidocs/padl.utils.html
@@ -95,6 +95,10 @@
 <li class="toctree-l3"><a class="reference internal" href="../usage/pytorch.html#weight-sharing">Weight Sharing</a></li>
 </ul>
 </li>
+<li class="toctree-l2"><a class="reference internal" href="../usage/debugging_your_transforms.html">Debugging your Transforms</a><ul>
+<li class="toctree-l3"><a class="reference internal" href="../usage/debugging_your_transforms.html#example">Example</a></li>
+</ul>
+</li>
 <li class="toctree-l2"><a class="reference internal" href="../usage/extras.html">Extras</a><ul>
 <li class="toctree-l3"><a class="reference internal" href="../usage/extras.html#the-same-utility">The <code class="xref py py-obj docutils literal notranslate"><span class="pre">same</span></code> Utility</a></li>
 <li class="toctree-l3"><a class="reference internal" href="../usage/extras.html#applying-transforms-depending-on-the-mode">Applying Transforms Depending on the Mode</a></li>
diff --git a/docs/unstable/apidocs/padl.version.html b/docs/unstable/apidocs/padl.version.html
index a2ac9c43..e60c0289 100644
--- a/docs/unstable/apidocs/padl.version.html
+++ b/docs/unstable/apidocs/padl.version.html
@@ -95,6 +95,10 @@
 <li class="toctree-l3"><a class="reference internal" href="../usage/pytorch.html#weight-sharing">Weight Sharing</a></li>
 </ul>
 </li>
+<li class="toctree-l2"><a class="reference internal" href="../usage/debugging_your_transforms.html">Debugging your Transforms</a><ul>
+<li class="toctree-l3"><a class="reference internal" href="../usage/debugging_your_transforms.html#example">Example</a></li>
+</ul>
+</li>
 <li class="toctree-l2"><a class="reference internal" href="../usage/extras.html">Extras</a><ul>
 <li class="toctree-l3"><a class="reference internal" href="../usage/extras.html#the-same-utility">The <code class="xref py py-obj docutils literal notranslate"><span class="pre">same</span></code> Utility</a></li>
 <li class="toctree-l3"><a class="reference internal" href="../usage/extras.html#applying-transforms-depending-on-the-mode">Applying Transforms Depending on the Mode</a></li>
diff --git a/docs/unstable/apidocs/padl.wrap.html b/docs/unstable/apidocs/padl.wrap.html
index 5aa00dac..02cc113f 100644
--- a/docs/unstable/apidocs/padl.wrap.html
+++ b/docs/unstable/apidocs/padl.wrap.html
@@ -94,6 +94,10 @@
 <li class="toctree-l3"><a class="reference internal" href="../usage/pytorch.html#weight-sharing">Weight Sharing</a></li>
 </ul>
 </li>
+<li class="toctree-l2"><a class="reference internal" href="../usage/debugging_your_transforms.html">Debugging your Transforms</a><ul>
+<li class="toctree-l3"><a class="reference internal" href="../usage/debugging_your_transforms.html#example">Example</a></li>
+</ul>
+</li>
 <li class="toctree-l2"><a class="reference internal" href="../usage/extras.html">Extras</a><ul>
 <li class="toctree-l3"><a class="reference internal" href="../usage/extras.html#the-same-utility">The <code class="xref py py-obj docutils literal notranslate"><span class="pre">same</span></code> Utility</a></li>
 <li class="toctree-l3"><a class="reference internal" href="../usage/extras.html#applying-transforms-depending-on-the-mode">Applying Transforms Depending on the Mode</a></li>
diff --git a/docs/unstable/genindex.html b/docs/unstable/genindex.html
index 2aa7aa24..2234e390 100644
--- a/docs/unstable/genindex.html
+++ b/docs/unstable/genindex.html
@@ -92,6 +92,10 @@
 <li class="toctree-l3"><a class="reference internal" href="usage/pytorch.html#weight-sharing">Weight Sharing</a></li>
 </ul>
 </li>
+<li class="toctree-l2"><a class="reference internal" href="usage/debugging_your_transforms.html">Debugging your Transforms</a><ul>
+<li class="toctree-l3"><a class="reference internal" href="usage/debugging_your_transforms.html#example">Example</a></li>
+</ul>
+</li>
 <li class="toctree-l2"><a class="reference internal" href="usage/extras.html">Extras</a><ul>
 <li class="toctree-l3"><a class="reference internal" href="usage/extras.html#the-same-utility">The <code class="xref py py-obj docutils literal notranslate"><span class="pre">same</span></code> Utility</a></li>
 <li class="toctree-l3"><a class="reference internal" href="usage/extras.html#applying-transforms-depending-on-the-mode">Applying Transforms Depending on the Mode</a></li>
@@ -653,7 +657,7 @@ <h2 id="P">P</h2>
         <li><a href="apidocs/padl.transforms.html#padl.transforms.Transform.pd_forward_device_check">(padl.transforms.Transform method)</a>
 </li>
       </ul></li>
-      <li><a href="apidocs/padl.transforms.html#padl.transforms.Transform.pd_get_loader">pd_get_loader() (padl.transforms.Transform static method)</a>
+      <li><a href="apidocs/padl.transforms.html#padl.transforms.Transform.pd_get_loader">pd_get_loader() (padl.transforms.Transform method)</a>
 </li>
       <li><a href="apidocs/padl.transforms.html#padl.transforms.Transform.pd_layers">pd_layers (padl.transforms.Transform property)</a>
 </li>
diff --git a/docs/unstable/index.html b/docs/unstable/index.html
index 6aaf8b53..f5f0fea9 100644
--- a/docs/unstable/index.html
+++ b/docs/unstable/index.html
@@ -94,6 +94,10 @@
 <li class="toctree-l3"><a class="reference internal" href="usage/pytorch.html#weight-sharing">Weight Sharing</a></li>
 </ul>
 </li>
+<li class="toctree-l2"><a class="reference internal" href="usage/debugging_your_transforms.html">Debugging your Transforms</a><ul>
+<li class="toctree-l3"><a class="reference internal" href="usage/debugging_your_transforms.html#example">Example</a></li>
+</ul>
+</li>
 <li class="toctree-l2"><a class="reference internal" href="usage/extras.html">Extras</a><ul>
 <li class="toctree-l3"><a class="reference internal" href="usage/extras.html#the-same-utility">The <code class="xref py py-obj docutils literal notranslate"><span class="pre">same</span></code> Utility</a></li>
 <li class="toctree-l3"><a class="reference internal" href="usage/extras.html#applying-transforms-depending-on-the-mode">Applying Transforms Depending on the Mode</a></li>
@@ -198,6 +202,7 @@ <h1>Welcome to PADL’s documentation!<a class="headerlink" href="#welcome-to-pa
 <li class="toctree-l2"><a class="reference internal" href="usage/saving.html">Saving and Loading</a></li>
 <li class="toctree-l2"><a class="reference internal" href="usage/print_slice.html">Printing and Slicing</a></li>
 <li class="toctree-l2"><a class="reference internal" href="usage/pytorch.html">Using PyTorch Modules with Transforms</a></li>
+<li class="toctree-l2"><a class="reference internal" href="usage/debugging_your_transforms.html">Debugging your Transforms</a></li>
 <li class="toctree-l2"><a class="reference internal" href="usage/extras.html">Extras</a></li>
 <li class="toctree-l2"><a class="reference internal" href="usage.html#import-anything-you-need-from-padl">Import anything you need <code class="docutils literal notranslate"><span class="pre">from</span> <span class="pre">padl</span></code></a></li>
 </ul>
diff --git a/docs/unstable/modules.html b/docs/unstable/modules.html
index 2cd40329..6ba36f9b 100644
--- a/docs/unstable/modules.html
+++ b/docs/unstable/modules.html
@@ -95,6 +95,10 @@
 <li class="toctree-l3"><a class="reference internal" href="usage/pytorch.html#weight-sharing">Weight Sharing</a></li>
 </ul>
 </li>
+<li class="toctree-l2"><a class="reference internal" href="usage/debugging_your_transforms.html">Debugging your Transforms</a><ul>
+<li class="toctree-l3"><a class="reference internal" href="usage/debugging_your_transforms.html#example">Example</a></li>
+</ul>
+</li>
 <li class="toctree-l2"><a class="reference internal" href="usage/extras.html">Extras</a><ul>
 <li class="toctree-l3"><a class="reference internal" href="usage/extras.html#the-same-utility">The <code class="xref py py-obj docutils literal notranslate"><span class="pre">same</span></code> Utility</a></li>
 <li class="toctree-l3"><a class="reference internal" href="usage/extras.html#applying-transforms-depending-on-the-mode">Applying Transforms Depending on the Mode</a></li>
diff --git a/docs/unstable/objects.inv b/docs/unstable/objects.inv
index 1dc2af07..fa6502e8 100644
Binary files a/docs/unstable/objects.inv and b/docs/unstable/objects.inv differ
diff --git a/docs/unstable/py-modindex.html b/docs/unstable/py-modindex.html
index c79672f0..440fbfa6 100644
--- a/docs/unstable/py-modindex.html
+++ b/docs/unstable/py-modindex.html
@@ -95,6 +95,10 @@
 <li class="toctree-l3"><a class="reference internal" href="usage/pytorch.html#weight-sharing">Weight Sharing</a></li>
 </ul>
 </li>
+<li class="toctree-l2"><a class="reference internal" href="usage/debugging_your_transforms.html">Debugging your Transforms</a><ul>
+<li class="toctree-l3"><a class="reference internal" href="usage/debugging_your_transforms.html#example">Example</a></li>
+</ul>
+</li>
 <li class="toctree-l2"><a class="reference internal" href="usage/extras.html">Extras</a><ul>
 <li class="toctree-l3"><a class="reference internal" href="usage/extras.html#the-same-utility">The <code class="xref py py-obj docutils literal notranslate"><span class="pre">same</span></code> Utility</a></li>
 <li class="toctree-l3"><a class="reference internal" href="usage/extras.html#applying-transforms-depending-on-the-mode">Applying Transforms Depending on the Mode</a></li>
diff --git a/docs/unstable/search.html b/docs/unstable/search.html
index 18b0a9a7..61ee99ff 100644
--- a/docs/unstable/search.html
+++ b/docs/unstable/search.html
@@ -95,6 +95,10 @@
 <li class="toctree-l3"><a class="reference internal" href="usage/pytorch.html#weight-sharing">Weight Sharing</a></li>
 </ul>
 </li>
+<li class="toctree-l2"><a class="reference internal" href="usage/debugging_your_transforms.html">Debugging your Transforms</a><ul>
+<li class="toctree-l3"><a class="reference internal" href="usage/debugging_your_transforms.html#example">Example</a></li>
+</ul>
+</li>
 <li class="toctree-l2"><a class="reference internal" href="usage/extras.html">Extras</a><ul>
 <li class="toctree-l3"><a class="reference internal" href="usage/extras.html#the-same-utility">The <code class="xref py py-obj docutils literal notranslate"><span class="pre">same</span></code> Utility</a></li>
 <li class="toctree-l3"><a class="reference internal" href="usage/extras.html#applying-transforms-depending-on-the-mode">Applying Transforms Depending on the Mode</a></li>
diff --git a/docs/unstable/searchindex.js b/docs/unstable/searchindex.js
index 4e29522e..d3f2376d 100644
--- a/docs/unstable/searchindex.js
+++ b/docs/unstable/searchindex.js
@@ -1,1 +1,1 @@
-Search.setIndex({docnames:["README","advanced","advanced/saving","apidocs/padl","apidocs/padl.dumptools","apidocs/padl.dumptools.ast_utils","apidocs/padl.dumptools.inspector","apidocs/padl.dumptools.packagefinder","apidocs/padl.dumptools.serialize","apidocs/padl.dumptools.sourceget","apidocs/padl.dumptools.symfinder","apidocs/padl.dumptools.var2mod","apidocs/padl.exceptions","apidocs/padl.print_utils","apidocs/padl.transforms","apidocs/padl.util_transforms","apidocs/padl.utils","apidocs/padl.version","apidocs/padl.wrap","index","modules","usage","usage/apply","usage/combining_transforms","usage/creating_transforms","usage/extras","usage/print_slice","usage/pytorch","usage/saving","usage/stages","usage/transform"],envversion:{"sphinx.domains.c":2,"sphinx.domains.changeset":1,"sphinx.domains.citation":1,"sphinx.domains.cpp":4,"sphinx.domains.index":1,"sphinx.domains.javascript":2,"sphinx.domains.math":2,"sphinx.domains.python":3,"sphinx.domains.rst":2,"sphinx.domains.std":2,"sphinx.ext.intersphinx":1,sphinx:56},filenames:["README.md","advanced.md","advanced/saving.md","apidocs/padl.md","apidocs/padl.dumptools.md","apidocs/padl.dumptools.ast_utils.md","apidocs/padl.dumptools.inspector.md","apidocs/padl.dumptools.packagefinder.md","apidocs/padl.dumptools.serialize.md","apidocs/padl.dumptools.sourceget.md","apidocs/padl.dumptools.symfinder.md","apidocs/padl.dumptools.var2mod.md","apidocs/padl.exceptions.md","apidocs/padl.print_utils.md","apidocs/padl.transforms.md","apidocs/padl.util_transforms.md","apidocs/padl.utils.md","apidocs/padl.version.md","apidocs/padl.wrap.md","index.md","modules.md","usage.md","usage/apply.md","usage/combining_transforms.md","usage/creating_transforms.md","usage/extras.md","usage/print_slice.md","usage/pytorch.md","usage/saving.md","usage/stages.md","usage/transform.md"],objects:{"":[[3,0,0,"-","padl"]],"padl.dumptools":[[5,0,0,"-","ast_utils"],[6,0,0,"-","inspector"],[7,0,0,"-","packagefinder"],[8,0,0,"-","serialize"],[9,0,0,"-","sourceget"],[10,0,0,"-","symfinder"],[11,0,0,"-","var2mod"]],"padl.dumptools.ast_utils":[[5,1,1,"","Position"],[5,2,1,"","get_position"],[5,2,1,"","get_source_segment"]],"padl.dumptools.inspector":[[6,1,1,"","CallInfo"],[6,2,1,"","caller_frame"],[6,2,1,"","caller_module"],[6,2,1,"","get_segment_from_frame"],[6,2,1,"","get_statement"],[6,2,1,"","get_surrounding_block"],[6,2,1,"","non_init_caller_frameinfo"],[6,2,1,"","outer_caller_frameinfo"],[6,2,1,"","trace_this"]],"padl.dumptools.inspector.CallInfo":[[6,3,1,"","module"]],"padl.dumptools.packagefinder":[[7,2,1,"","dump_packages_versions"],[7,2,1,"","get_packages"],[7,2,1,"","get_version"]],"padl.dumptools.serialize":[[8,1,1,"","Serializer"],[8,2,1,"","json_serializer"],[8,2,1,"","load_json"],[8,2,1,"","save_json"],[8,2,1,"","value"]],"padl.dumptools.serialize.Serializer":[[8,4,1,"","save"],[8,4,1,"","save_all"],[8,3,1,"","varname"]],"padl.dumptools.sourceget":[[9,1,1,"","ReplaceString"],[9,1,1,"","ReplaceStrings"],[9,2,1,"","cut"],[9,2,1,"","get_module_source"],[9,2,1,"","get_source"],[9,2,1,"","original"],[9,2,1,"","put_into_cache"]],"padl.dumptools.sourceget.ReplaceString":[[9,4,1,"","cut"]],"padl.dumptools.sourceget.ReplaceStrings":[[9,4,1,"","cut"]],"padl.dumptools.symfinder":[[10,5,1,"","NameNotFound"],[10,1,1,"","Scope"],[10,1,1,"","ScopedName"],[10,2,1,"","find"],[10,2,1,"","find_in_ipython"],[10,2,1,"","find_in_module"],[10,2,1,"","find_in_scope"],[10,2,1,"","find_in_source"],[10,2,1,"","replace_star_imports"],[10,2,1,"","split_call"]],"padl.dumptools.symfinder.Scope":[[10,4,1,"","empty"],[10,4,1,"","from_level"],[10,4,1,"","from_source"],[10,4,1,"","global_"],[10,4,1,"","is_global"],[10,3,1,"","module_name"],[10,4,1,"","toplevel"],[10,4,1,"","unscoped"],[10,4,1,"","up"]],"padl.dumptools.var2mod":[[11,1,1,"","CodeGraph"],[11,1,1,"","CodeNode"],[11,1,1,"","Finder"],[11,1,1,"","Vars"],[11,2,1,"","find_codenode"],[11,2,1,"","find_globals"],[11,2,1,"","increment_same_name_var"],[11,2,1,"","rename"]],"padl.dumptools.var2mod.CodeGraph":[[11,4,1,"","build"],[11,4,1,"","dumps"],[11,4,1,"","print"]],"padl.dumptools.var2mod.CodeNode":[[11,4,1,"","from_source"]],"padl.dumptools.var2mod.Finder":[[11,4,1,"","find"],[11,4,1,"","generic_visit"],[11,4,1,"","get_source_segments"]],"padl.dumptools.var2mod.Vars":[[11,6,1,"","globals"],[11,6,1,"","locals"]],"padl.exceptions":[[12,5,1,"","WrongDeviceError"]],"padl.print_utils":[[13,2,1,"","combine_multi_line_strings"],[13,2,1,"","create_arrow"],[13,2,1,"","create_reverse_arrow"],[13,2,1,"","format_argument"],[13,2,1,"","make_bold"],[13,2,1,"","make_green"],[13,2,1,"","visible_len"]],"padl.transforms":[[14,1,1,"","AtomicTransform"],[14,1,1,"","Batchify"],[14,1,1,"","BuiltinTransform"],[14,1,1,"","ClassTransform"],[14,1,1,"","Compose"],[14,1,1,"","FunctionTransform"],[14,1,1,"","Identity"],[14,1,1,"","Map"],[14,1,1,"","Parallel"],[14,1,1,"","Pipeline"],[14,1,1,"","Rollout"],[14,1,1,"","TorchModuleTransform"],[14,1,1,"","Transform"],[14,1,1,"","Unbatchify"],[14,2,1,"","fulldump"],[14,2,1,"","group"],[14,2,1,"","importdump"],[14,2,1,"","load"],[14,2,1,"","save"]],"padl.transforms.ClassTransform":[[14,3,1,"","source"]],"padl.transforms.FunctionTransform":[[14,3,1,"","source"]],"padl.transforms.Pipeline":[[14,4,1,"","grouped"],[14,4,1,"","pd_forward_device_check"],[14,4,1,"","pd_to"]],"padl.transforms.TorchModuleTransform":[[14,4,1,"","post_load"],[14,4,1,"","pre_save"]],"padl.transforms.Transform":[[14,4,1,"","eval_apply"],[14,4,1,"","infer_apply"],[14,4,1,"","pd_call_in_mode"],[14,3,1,"","pd_device"],[14,3,1,"","pd_forward"],[14,4,1,"","pd_forward_device_check"],[14,4,1,"","pd_get_loader"],[14,3,1,"","pd_layers"],[14,3,1,"","pd_name"],[14,4,1,"","pd_parameters"],[14,4,1,"","pd_post_load"],[14,3,1,"","pd_postprocess"],[14,4,1,"","pd_pre_save"],[14,3,1,"","pd_preprocess"],[14,4,1,"","pd_save"],[14,3,1,"","pd_stages"],[14,4,1,"","pd_to"],[14,4,1,"","pd_varname"],[14,4,1,"","pd_zip_save"],[14,4,1,"","train_apply"]],"padl.util_transforms":[[15,1,1,"","IfEval"],[15,1,1,"","IfInMode"],[15,1,1,"","IfInfer"],[15,1,1,"","IfTrain"],[15,1,1,"","Try"]],"padl.utils":[[16,6,1,"","same"]],"padl.wrap":[[18,1,1,"","PatchedModule"],[18,2,1,"","transform"]],padl:[[3,1,1,"","Batchify"],[3,1,1,"","Identity"],[3,1,1,"","IfEval"],[3,1,1,"","IfInMode"],[3,1,1,"","IfInfer"],[3,1,1,"","IfTrain"],[3,1,1,"","Unbatchify"],[4,0,0,"-","dumptools"],[12,0,0,"-","exceptions"],[3,2,1,"","fulldump"],[3,2,1,"","group"],[3,2,1,"","importdump"],[3,2,1,"","load"],[13,0,0,"-","print_utils"],[3,2,1,"","save"],[3,2,1,"","transform"],[14,0,0,"-","transforms"],[3,7,1,"","unbatch"],[15,0,0,"-","util_transforms"],[16,0,0,"-","utils"],[3,2,1,"","value"],[17,0,0,"-","version"],[18,0,0,"-","wrap"]]},objnames:{"0":["py","module","Python module"],"1":["py","class","Python class"],"2":["py","function","Python function"],"3":["py","property","Python property"],"4":["py","method","Python method"],"5":["py","exception","Python exception"],"6":["py","attribute","Python attribute"],"7":["py","data","Python data"]},objtypes:{"0":"py:module","1":"py:class","2":"py:function","3":"py:property","4":"py:method","5":"py:exception","6":"py:attribute","7":"py:data"},terms:{"0":[0,3,6,9,10,11,14,25,26],"0x":11,"1":[0,2,3,9,10,11,14,15,23,25,26,27],"10":[0,3,15,24],"100":[2,11,23,24,25,26],"1000":24,"11":[3,6,15],"123":6,"13":9,"2":[0,3,9,10,11,14,23,25,26],"20":0,"200":25,"244":23,"3":[0,3,5,6,10,11,14,23,25],"300":25,"4":[11,25],"5":9,"7":0,"8":[0,5],"9":[0,9],"99":[3,15],"abstract":[0,14,19,30],"case":[2,3,9,10,14,23],"catch":[15,21],"class":[2,3,5,6,8,9,10,11,14,15,18,24,29],"const":2,"default":[2,3,6,7,8,10,14,15,23],"do":[2,3,12,14,21,22,24],"final":[15,25],"function":[0,2,3,6,8,10,11,14,18,19,23,24,30],"import":[0,2,3,7,10,11,14,15,18,19,22,23,24,25,28,29],"int":[5,6,9,10,11,13,14],"new":[9,10],"return":[0,2,6,7,8,9,10,11,14,22,23,24,25,26,29],"static":14,"switch":[2,3,14],"true":[3,7,9,10,11,13,14,18,23,26],"try":[3,6,9,14,15,18,21,25],"var":11,A:[3,6,9,10,11,14,30],As:[2,11,29],By:23,For:[2,23,24,25],If:[0,2,3,8,9,10,11,13,14,15],In:[3,9,10,14,23,24],It:[2,6,10,14,22,24,27],No:15,One:[2,23],The:[2,3,6,8,9,10,11,13,14,15,21,22,23,29,30],These:[2,14],To:[2,3,9,14,22,23,29],With:30,_:2,____________:13,__call__:[2,24],__file__:2,__init__:[2,6,24],__main__:10,_ast:[10,11],_generatorwithlength:22,_pd_main:2,_thingfind:10,_trace_thi:6,a_transform:2,about:[6,14,27,30],abov:23,absolut:2,accept:14,access:[10,26,29],ad:[3,10,14,22,30],adam:27,adapt:27,add:[2,3,9,14,24,25,26],add_n:2,addconst:2,addfirst:25,addit:9,advanc:19,after:[2,3,14,27],again:2,ai:[0,19],airplan:22,alia:11,all:[0,2,6,8,11,12,14,18,19,21,22,23,27,28],allow:[0,9,10,19,22,23,25],along:27,also:[2,3,14,22,24,25],alwai:14,an:[0,2,6,9,10,11,13,14,19,22,25,27,30],analog:25,ani:[3,8,13,14,15],anoth:13,anyth:[2,19],apach:0,api:19,append:[2,8],appli:[2,3,13,14,15,19,21,23,29],applic:25,ar:[2,3,8,10,11,14,21,22,23,24,27,28,29],arbitrari:[0,19,25],arg:[2,6,14,22,26],argument:[2,6,10,13,14,22],aris:23,arrai:[2,11,25],arrow:13,ascii:13,assign:[10,14],ast:[5,7,10,11],ast_nod:11,ast_util:[19,20],atom:14,atomictransform:14,attribut:[6,9,16],augment:[23,25,27,29],automat:[2,3,14,22],avail:[6,22],awar:2,axxxxxxxxxxxxxxxxxxxx:9,b:[3,9,11,14,15],back:15,backward:27,bar:[11,22,23],base:[0,8,14,19],batch:[0,3,14,21,22,23,27,29,30],batch_siz:[22,27],batchifi:[3,10,14,21],baz:23,becaus:0,becom:[6,10,23,24],been:14,befor:[2,6,14,22],being:[3,14,25],below:11,berlin:[0,19],between:[11,23],big:2,bla:7,blip:7,blob:0,block:6,blop:7,blu:7,bodi:[2,6,7,10,11],boilerpl:30,bold:13,bool:[3,6,9,10,11,14],both:[2,9,27],build:[0,2,10,11,19,30],build_my_transform:2,builder:[0,19],built:27,builtin:14,builtintransform:14,bup:7,c:[3,14],cach:9,call:[3,6,8,10,11,14,15,24,29],call_info:14,call_sourc:10,callabl:[3,6,8,14,18,24],caller:6,caller_fram:6,caller_modul:6,callinfo:[6,14],calling_scop:10,can:[0,2,3,6,9,10,14,15,19,22,23,24,25,26,27,28,29,30],canb:22,cannot:2,capabl:27,captur:16,carri:15,cat:22,catch_transform:15,caus:2,caveat:2,cell:9,central:30,chang:[2,6,15],charact:13,check:14,checkpoint:28,child:[12,14],child_transform:12,children:14,classifi:[23,29],classmethod:[8,10,11],classtransform:14,claus:15,clean:2,close:25,code:[0,2,3,6,7,8,9,10,11,14,27,30],code_of_conduct:0,codegraph:[8,11],codenod:11,col:[6,9,11],col_offset:5,collect:[9,14,21],column:6,com:0,combin:[13,14,19,21,24,30],combine_multi_line_str:13,come:[18,24],comment:6,common:23,complet:[6,15],complex:[2,14,26,30],compon:[0,19,23],compos:[14,26,29],composit:23,comprehens:0,compress:[3,14],concat_low:25,concis:[0,21],condit:[15,21],condition:23,conduct:0,conflict:2,consid:2,consist:2,constant:[2,9],construct:14,contain:[2,6,8,9,10,12,13,14,27,28],content:11,context:[6,14],continu:[23,29],contrast:14,contribut:19,conveni:27,convert:[0,10,19,24,27,29],coor:13,coordin:13,correct:14,correspond:[5,10,11,29],could:[2,10,23],count:10,counter:[10,11],cpu:[3,14],creat:[0,2,6,8,10,11,13,14,19,21,22,23,27,28,30],create_arrow:13,create_reverse_arrow:13,crop:23,cuda:[14,27],current:[0,2,10],custom:[14,30],cut:9,data:[2,14,19,21,29,30],dataload:[14,22,30],datapoint:[14,23],dataset:2,debug:[11,30],decor:[3,14,18,24],deep:[0,2,19,23,29,30],def:[0,2,6,10,11,14,24,25,26,29],def_sourc:10,defin:[8,10,11,21,28,29],definit:2,depend:[2,11,28],detail:[6,14,23],determin:[3,6,9,11,14,18],develop:[0,19],devic:[3,12,14,22],di:30,dict:9,dictionari:[2,14],differ:[2,9,22,29],dim:[3,14],dimens:[3,14,22,30],directli:14,directori:2,disabl:[3,13,14,22],document:[6,14],doe:[14,22],doesn:[3,15],dog:22,don:[2,3,6,13,14,18],done:[14,22],down:2,drop:[6,10],drop_n:[6,10],dump:[2,3,7,8,11,14],dump_packages_vers:7,dumptool:[14,19,20],dure:[3,14,23,25],e:[3,10,14],each:[2,14,22,29],easili:30,ecosystem:[0,19],edg:11,effect:2,either:[2,9],eleg:30,element:[14,23,29],els:[3,11,15],else_:[3,15],else_transform:15,empti:[6,10],enabl:[2,3,14,30],end:[3,11,13,14],end_col_offset:5,end_lineno:5,enter:6,entir:24,entiti:10,entri:2,enumer:2,equival:25,error:15,escap:13,eval:[3,14,15,21,22,25],eval_appli:[3,14,15,22,25],evalu:29,even:23,event:6,everi:13,everyth:[11,21,23,24],exactli:23,exampl:[0,2,3,6,7,9,10,11,13,14,15,18,22,25,29],except:[10,15,19,20,21],execut:[0,2,6,23],exist:[3,11,14],expect:[2,3,9,14,22],explicit:[9,11],explicitli:14,extens:[3,14],extra:[15,19,21,27],extract:6,f1:14,f2:14,f:[2,9,10,11,14],factori:16,fail:15,fall:15,fals:[3,6,10,11,13,14,18],few:2,field:11,file:[2,3,9,14,25,28],file_suffix:8,fileexistserror:[3,14],filenam:[2,9,14,25],filter_builtin:11,finally_transform:15,find:[0,7,10,11],find_codenod:11,find_glob:11,find_in_ipython:10,find_in_modul:10,find_in_scop:10,find_in_sourc:10,finder:11,finish_right:13,first:[3,6,9,13,14,23],flat:23,flatten:[3,14,23],flexibl:30,folder:[2,3,14,28],follow:[2,6,10,11,21],foo:[7,11,14,23],force_overwrit:[3,14],form:[10,14,24,30],formal:30,format:[7,13,29,30],format_argu:13,forward:[0,14,19,21,22,24],found:[6,10,11],four:10,frame:[6,9],frameinfo:6,from:[0,3,6,7,9,10,11,14,15,19,22,24,25,27,28,29],from_:11,from_col:9,from_level:10,from_lin:9,from_sourc:[10,11],front:6,full:[0,2,3,14],fulldump:[2,3,14],fulli:[3,14],functiontransform:14,fundament:14,futur:2,g:14,gener:[14,22],generic_visit:11,germani:[0,19],get:[2,5,6,7,9,10,11,13,14,16,19,21,23,25],get_module_sourc:9,get_packag:7,get_posit:5,get_segment_from_fram:6,get_sourc:9,get_source_seg:[5,11],get_stat:6,get_surrounding_block:6,get_vers:7,getitem:[6,26],github:0,give:9,given:[3,6,7,9,10,11,14],global:[2,10,11],global_:10,globals_:11,go:[0,11],good:14,gotten:9,gpu:[14,22,29,30],gradient:[14,22,30],graph:11,great:[0,19],green:13,group:[3,14,21],ha:[2,9,11,14,23,27,29],hacki:6,handl:22,happen:[15,29],have:[0,14,19,27],head:23,hello:25,help:14,helper:[3,8],here:[2,6],hidden:24,hierarchi:10,histori:10,hood:22,how:[10,14,22,23,24,26,28,29,30],howev:2,http:0,i:[2,3,10,14],id:9,ident:[3,14,15,21,26],identifi:10,if_:[3,15],ifev:[3,15,21,25],iff:10,ifinf:[3,15,21,25],ifinmod:[3,15],iftrain:[3,15,21,23,25],ignor:14,ignore_grad:14,ignore_scop:[3,6,14,18],iim:[3,15],imag:[13,29],implement:[14,24],importdump:[2,3,14],includ:[2,9,14,27,28],increment:11,increment_same_name_var:11,indent:6,index:14,indic:[10,14],individu:23,infer:[3,14,15,21,22,25,27,29],infer_appli:[3,14,15,22,25],infer_pipelin:27,inform:[6,14],initi:[2,14,27],inlin:[6,14],innov:[0,19],input:[3,9,13,14,22,23,25],insert:9,insid:15,inspect:[6,9,14,30],inspector:[14,19,20],instanc:[2,22,23,24,27],instead:[2,3,6,14,18],interact:[2,28,30],interest:0,intern:22,introduct:19,invers:[3,14],io:0,ipython:[2,9,10,26],is_glob:10,isinst:[9,11,18],issu:0,item:[0,3,10,14,16,22,25],iter:[14,22,27],its:[10,11,14],itself:6,jpg:22,json:[2,8],json_seri:8,just:[2,3,14],keep:23,kei:9,keyword:[0,14,19],know:21,kwarg:[6,14],l1:24,l2:24,lab:[0,19],lambda:[3,14,15,23,24,25],larg:2,larger:6,largest:6,last:[2,9,13,14],layer1:27,layer2:27,layer:[0,14,19],learn:[0,19,22,23,24,27,28,29,30],len:[2,22],length:[13,23],level:[2,6,10,23],lf1:[0,19],licens:19,like:[2,22,29],limit:2,lin:24,line:[6,9,10,13],linear:[0,24],lineno:[5,6,10,11],list:[2,3,7,9,10,11,13,14,15,22,25,27,28],liter:[3,6,14,15],live:11,load:[0,2,3,8,14,19,21,22,23,27,29],load_data:2,load_funct:8,load_imag:[23,29],load_json:8,loader:[8,14],loc:9,local:11,locat:[6,9],log10:24,look:[0,2,6,10],lookup:[27,29],loop:[10,22,27],loss:[0,19,23,27],lower:25,lr:27,macro:23,made:[6,14],mai:[0,19],main:[0,10,12],maintain:9,make:[0,13,19,21,27],make_bold:13,make_green:13,manual:0,map:14,mark:[3,8,14],match:[3,6,12,14,15],math:24,md:0,mean:[2,3,14,23],messi:2,method:[6,14,21,25],might:[2,25],minim:30,minus100:24,minusx:[24,25,26],mlp:24,mml:24,mode:[3,14,15,22],model:[0,2,14,19,27,29],model_pass:23,modifi:9,modul:[3,6,7,8,9,10,11,14,18,19,21,23,24,26,28,29],module_nam:[6,10],more:[2,3,6,14,23,30],most:[10,23,29],mother:12,mother_transform:12,move:[3,14,23],much:30,multi:[6,13,30],multipl:[2,14,22,24,27],multiprocess:14,must:[2,6,14,23],my:2,my_classifi:[22,29],my_classifier_transform:[23,29],my_pipelin:[0,2,27,28],myfil:2,myfunct:6,mykei:9,myload:2,mypipelin:28,mypytorchlay:27,mysav:2,mytransform:2,n:[6,10,11,14],n_final_row:13,n_in:24,n_initial_row:13,n_out:24,n_to_add:2,name:[2,3,6,7,10,11,14,15,29],namenotfound:10,natur:22,need:[2,8,14,19],nest:[10,26,27],never:14,next:[22,23,24,26,27,28,29,30],nextmodul:6,nn:[0,14,24],node:[5,7,10,11],nodetyp:11,nodevisitor:11,non:9,non_init_caller_frameinfo:6,none:[3,6,8,10,11,14,15,18],normal:[2,9,14],not_found:2,note:[2,6],notebook:[0,2,30],noth:[3,14,21],now:2,np:[2,11,18,24,25],npy:2,nth:23,num_work:[22,27],number:[6,10,11,13],numpi:[2,18,24],o:11,object:[6,9,10,11,14,22,25],occur:15,offset:[6,11],often:25,one:[2,3,10,13,14,15,23,29],onli:[2,11,23,25],open:[2,23,25],open_fil:25,oper:23,optim:27,option:[3,6,8,11,14,15],order:14,ordereddict:14,origin:[6,9],other:[14,15],otherwis:[3,14,15],out:[6,9,10,11,15,18,23,24],outer:6,outer_caller_frameinfo:6,output:[3,14,15,22,23,29],over:[13,14,23,27],overlap:9,overrid:14,overwrit:[3,14],own:2,packag:[0,2,3,7,14,19,28],packagefind:[19,20],pad:13,padl:[2,20,23,24,25,26,28,29,30],padl_value_0:2,page:21,parallel:[3,14],param:14,paramet:[2,3,6,7,8,9,10,11,12,13,14,15,18,28],parent:[2,18],parenthes:23,pars:[7,11],part:[9,14,21,22,29],parti:2,particular:24,pass:[0,2,3,14,19,22],patch:18,patchedmodul:18,path:[2,3,8,14,23,29],pathlib:[2,3,8,14],pd_call_in_mod:14,pd_devic:14,pd_forward:[14,22,29],pd_forward_device_check:14,pd_get_load:14,pd_group:14,pd_layer:[14,27],pd_name:[14,15],pd_np:18,pd_paramet:[14,27],pd_post_load:14,pd_postprocess:[14,29],pd_pre_sav:14,pd_preprocess:[14,29],pd_save:14,pd_stage:14,pd_to:[14,27],pd_varnam:14,pd_zip_sav:14,perform:[3,14,15],pick:2,piec:[10,11],pil:23,piltotensor:23,pip:0,pipelin:[0,14,19,21,22,24,26,27,28,29],pleas:0,pluson:2,plustwo:2,posit:[5,9,11],possibl:[2,6,14,24,27],post:[0,14,19,29],post_load:14,postprocess:[3,14,19,21,22,23],potenti:[2,6],power:23,pre:[0,9,14,19,29],pre_sav:14,preced:13,predict:[23,27],prefer:0,prepar:0,preprocess:[3,14,19,21,22,23,27,30],preprocess_imag:23,pretti:26,prevent:[2,3,14],previous:2,print:[6,11,13,14,19,21,28],print_util:[19,20],process:[0,2,14,19,22,29,30],progress:22,propag:14,properti:[6,8,10,14],provid:[2,23],pt:2,put:9,put_into_cach:9,py:[2,28],pypi:2,python:[0,2,5,6,10,11,19,23,24,28],pytorch:[0,14,19,21,22,23,24,26,28,29],rais:[3,6,14],rand:18,random:18,randomresizedcrop:23,randomrot:23,rang:2,rather:[2,6,14],re:[0,19,23],read:[2,21,22,25,26,30],read_from_path:25,readabl:29,recent:10,recreat:2,recurs:[3,14],refer:21,regardless:15,relu:24,rememb:27,remov:[3,6,14,22],renam:[2,11],rename_loc:11,repeat:[2,23],repl:9,replac:[9,10],replace_cach:9,replace_star_import:10,replacestr:9,repres:[10,11],reproduc:30,requir:[2,6],reshap:29,resiz:23,resnet18:[23,29],respect:[3,11,14,25],respons:[2,29],rest:6,result:[2,3,6,9,14,23],return_loc:6,return_parti:10,revers:2,roll:23,rollout:[3,14],row:6,rstring:9,s:[3,6,7,8,9,10,14,15,21,22,24,27,28,29],same:[3,5,6,9,10,11,14,16,21,23,27],save:[1,3,8,14,19,21,22,30],save_al:8,save_funct:8,save_json:8,saver:8,scope:[3,6,10,11,14,18],scoped_nam:11,scopednam:[10,11],scopelist:10,search:[10,11,14],second:[2,3,10,14,23],section:[9,22,23,24,26,27,28,29,30],see:[0,2,3,6,14,22],segment:[5,6,10,11],segment_typ:6,self:[2,10,14,24],send:[14,22,27,30],sequenc:[13,14,23],seri:14,serial:[3,14,19,20],session:[2,28],set:[2,8,11,14,22],settrac:6,should:[2,3,6,8,14],show:22,similar:2,simpli:[2,14],sin:24,singl:[0,14,19,22,23],size:22,slice:[19,21,28,30],slower:0,so:[10,23],some:[2,23,27],somemodul:11,someobject:2,someth:[2,25],sometim:2,soon:6,sourc:[5,6,7,9,10,11,14],sourceget:[19,20],space:[6,13],special:[23,25,29],specifi:[3,9,10,14,22],split:[2,10],split_cal:10,stack:6,stage:[14,19,21,22,23],stand:29,standard:[0,19],star:[2,10],start:[3,10,13,14,19,21],start_left:13,state_dict:27,statement:[2,3,6,10,14,15],step:[14,23,27],stop:30,store:[2,3,8,27,28],str:[2,3,6,8,9,10,11,13,14,15],string:[3,7,8,9,10,11,13,14],sub:[9,11,14,23,26],subclass:10,substr:9,subval:2,successfulli:15,suffix:2,suggest:29,superimpos:13,support:[0,2,22],surround:[6,10],sy:6,symbol:[2,10],symfind:[6,11,19,20],t1:[14,23,26],t2:[14,23,26],t3:[14,23,26],t4:26,t5:26,t:[2,3,6,13,14,15,18,23,25],take:[13,23],taken:[9,24],target:[6,23],target_mod:[3,15],tensor:[0,3,14,22],text:[0,2],textcorpu:2,than:2,them:[2,3,14,21,23,27],thereof:[3,14],thi:[2,3,6,9,10,11,13,14,15,22,23,24,26,27,28],thing:[2,3,8,9,10,11],third:2,those:[2,11,27,29],three:[22,23],through:[11,22,23],thu:[2,23],time:2,to_col:9,to_lin:9,toarrai:2,togeth:26,too:[24,26,28],top:[10,13],topic:19,topk:0,toplevel:[3,6,10,14,18],topolog:[0,19],torch:[0,14,24,27],torchmoduletransform:14,torchvis:[23,29],totensor:[23,29],tqdm:22,trace:6,trace_thi:6,tracefunc:6,track:2,train:[3,14,15,21,22,25,27,29],train_appli:[14,22,27],train_data:27,train_model:27,train_pipelin:27,training_pipelin:23,transform:[0,3,10,12,15,16,18,19,20,21,26,28,29],transform_or_modul:[3,14],transpar:[13,30],tree:[0,10,11],tupl:[2,3,6,10,11,14,15,23],turn:14,tvt:23,two:2,txt:[2,28],type:[6,11],typic:14,unbatch:[0,3,21,23,29],unbatchifi:[3,14],under:[0,22],undo:2,unind:6,union:[3,14,15],uniqu:14,unscop:10,unsqueez:[3,14],up:[2,10],updat:22,us:[0,2,3,6,7,8,9,10,11,13,14,15,18,19,21,22,23,24,25,26,29,30],usag:[0,19],use_replace_cach:9,user:[0,19],usual:29,util:[6,7,13,14,19,20,23,27],util_transform:[19,20],v:13,val:[2,3,8],valu:[3,8,9,10,13,21],valueerror:6,var2mod:[19,20],var_nam:10,variabl:[10,11,14],variou:[9,10],varnam:[8,10],veri:2,version:[0,2,7,9,10,14,19,20,28],via:[2,14,26,27,28,29],view:23,visibl:13,visible_len:13,visitor:11,wa:[0,6,14,19],wai:10,want:[2,25],we:[2,29],well:10,were:[2,10],what:[14,25,29],whatev:14,when:[2,3,14,15,24,27,28],where:[6,9,11,13],wherea:29,which:[2,3,6,9,10,11,14,22,23,28],whole:[14,30],whose:[3,14],wide:6,within:[6,9,10,14,27],without:30,word:2,word_index:2,wordindex:2,work:[26,27,30],worker:22,workflow:[29,30],worri:30,would:[2,9,10,23],wrap:[2,3,14,19,20,24],wrappe:[3,18],wrapper:[3,18,24],write:[0,2,3,14,19],written:10,wrongdeviceerror:12,x1:14,x2:14,x3:14,x:[0,2,3,9,10,11,13,14,15,23,24,25,26,29],xxxx:9,xxxxxaxxxxxxxxxxxxxxxxxxxx:9,xxxxxxxxxxx:9,xxxxxxxxxxxxxb:9,xxxxxxxxxxxxxbxxxx:9,y:[11,13,23,24,26],you:[0,2,19,23,25,30],your:[2,30],z:[11,23],zero_grad:27,zip:[3,14]},titles:["Introduction","Advanced Topics","Saving","<code class=\"docutils literal notranslate\"><span class=\"pre\">padl</span></code>","<code class=\"docutils literal notranslate\"><span class=\"pre\">padl.dumptools</span></code>","<code class=\"docutils literal notranslate\"><span class=\"pre\">padl.dumptools.ast_utils</span></code>","<code class=\"docutils literal notranslate\"><span class=\"pre\">padl.dumptools.inspector</span></code>","<code class=\"docutils literal notranslate\"><span class=\"pre\">padl.dumptools.packagefinder</span></code>","<code class=\"docutils literal notranslate\"><span class=\"pre\">padl.dumptools.serialize</span></code>","<code class=\"docutils literal notranslate\"><span class=\"pre\">padl.dumptools.sourceget</span></code>","<code class=\"docutils literal notranslate\"><span class=\"pre\">padl.dumptools.symfinder</span></code>","<code class=\"docutils literal notranslate\"><span class=\"pre\">padl.dumptools.var2mod</span></code>","<code class=\"docutils literal notranslate\"><span class=\"pre\">padl.exceptions</span></code>","<code class=\"docutils literal notranslate\"><span class=\"pre\">padl.print_utils</span></code>","<code class=\"docutils literal notranslate\"><span class=\"pre\">padl.transforms</span></code>","<code class=\"docutils literal notranslate\"><span class=\"pre\">padl.util_transforms</span></code>","<code class=\"docutils literal notranslate\"><span class=\"pre\">padl.utils</span></code>","<code class=\"docutils literal notranslate\"><span class=\"pre\">padl.version</span></code>","<code class=\"docutils literal notranslate\"><span class=\"pre\">padl.wrap</span></code>","Welcome to PADL\u2019s documentation!","API Documentation","Usage","Applying Transforms to Data","Combining Transforms into Pipelines","Creating Transforms","Extras","Printing and Slicing","Using PyTorch Modules with Transforms","Saving and Loading","Stages: Preprocess, Forward and Postprocess","<em>Transforms</em> and <em>Pipelines</em>"],titleterms:{"import":21,The:25,access:27,advanc:1,an:23,anyth:21,api:20,appli:[22,25],ast_util:5,automat:27,block:2,build:23,combin:23,compos:23,content:[1,19,20,21],contribut:0,convert:23,creat:24,custom:2,data:22,defin:2,depend:25,devic:27,dict:27,dictionari:23,differ:23,document:[19,20],doe:2,dumptool:[4,5,6,7,8,9,10,11],exampl:23,except:[12,25],extra:25,extract:23,first:0,forward:[23,29],from:[2,21,23],gener:23,get:0,group:23,handl:25,how:2,imag:23,inspector:6,instal:0,introduct:0,item:23,layer:27,licens:0,load:28,loop:2,map:23,mode:25,model:23,modul:[2,27],multipl:23,mutat:2,need:21,nest:2,object:2,other:2,packagefind:7,padl:[0,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,21,27],parallel:23,paramet:27,pass:23,pipelin:[23,30],post:23,postprocess:29,pre:23,preprocess:29,print:26,print_util:13,process:23,program:0,pytorch:[2,27],resourc:0,rollout:23,s:19,same:25,sampl:23,save:[2,27,28],scope:2,serial:[2,8],share:27,slice:26,sourceget:9,stage:29,start:0,state:27,symfind:10,target:2,tensor:23,topic:1,train:23,transform:[2,14,22,23,24,25,27,30],us:27,usag:21,util:[16,25],util_transform:15,valu:2,var2mod:11,variabl:2,version:[17,23],weight:27,welcom:19,what:2,within:2,work:2,wrap:18,you:21,your:0}})
\ No newline at end of file
+Search.setIndex({docnames:["README","advanced","advanced/saving","apidocs/padl","apidocs/padl.dumptools","apidocs/padl.dumptools.ast_utils","apidocs/padl.dumptools.inspector","apidocs/padl.dumptools.packagefinder","apidocs/padl.dumptools.serialize","apidocs/padl.dumptools.sourceget","apidocs/padl.dumptools.symfinder","apidocs/padl.dumptools.var2mod","apidocs/padl.exceptions","apidocs/padl.print_utils","apidocs/padl.transforms","apidocs/padl.util_transforms","apidocs/padl.utils","apidocs/padl.version","apidocs/padl.wrap","index","modules","usage","usage/apply","usage/combining_transforms","usage/creating_transforms","usage/debugging_your_transforms","usage/extras","usage/print_slice","usage/pytorch","usage/saving","usage/stages","usage/transform"],envversion:{"sphinx.domains.c":2,"sphinx.domains.changeset":1,"sphinx.domains.citation":1,"sphinx.domains.cpp":4,"sphinx.domains.index":1,"sphinx.domains.javascript":2,"sphinx.domains.math":2,"sphinx.domains.python":3,"sphinx.domains.rst":2,"sphinx.domains.std":2,"sphinx.ext.intersphinx":1,sphinx:56},filenames:["README.md","advanced.md","advanced/saving.md","apidocs/padl.md","apidocs/padl.dumptools.md","apidocs/padl.dumptools.ast_utils.md","apidocs/padl.dumptools.inspector.md","apidocs/padl.dumptools.packagefinder.md","apidocs/padl.dumptools.serialize.md","apidocs/padl.dumptools.sourceget.md","apidocs/padl.dumptools.symfinder.md","apidocs/padl.dumptools.var2mod.md","apidocs/padl.exceptions.md","apidocs/padl.print_utils.md","apidocs/padl.transforms.md","apidocs/padl.util_transforms.md","apidocs/padl.utils.md","apidocs/padl.version.md","apidocs/padl.wrap.md","index.md","modules.md","usage.md","usage/apply.md","usage/combining_transforms.md","usage/creating_transforms.md","usage/debugging_your_transforms.md","usage/extras.md","usage/print_slice.md","usage/pytorch.md","usage/saving.md","usage/stages.md","usage/transform.md"],objects:{"":[[3,0,0,"-","padl"]],"padl.dumptools":[[5,0,0,"-","ast_utils"],[6,0,0,"-","inspector"],[7,0,0,"-","packagefinder"],[8,0,0,"-","serialize"],[9,0,0,"-","sourceget"],[10,0,0,"-","symfinder"],[11,0,0,"-","var2mod"]],"padl.dumptools.ast_utils":[[5,1,1,"","Position"],[5,2,1,"","get_position"],[5,2,1,"","get_source_segment"]],"padl.dumptools.inspector":[[6,1,1,"","CallInfo"],[6,2,1,"","caller_frame"],[6,2,1,"","caller_module"],[6,2,1,"","get_segment_from_frame"],[6,2,1,"","get_statement"],[6,2,1,"","get_surrounding_block"],[6,2,1,"","non_init_caller_frameinfo"],[6,2,1,"","outer_caller_frameinfo"],[6,2,1,"","trace_this"]],"padl.dumptools.inspector.CallInfo":[[6,3,1,"","module"]],"padl.dumptools.packagefinder":[[7,2,1,"","dump_packages_versions"],[7,2,1,"","get_packages"],[7,2,1,"","get_version"]],"padl.dumptools.serialize":[[8,1,1,"","Serializer"],[8,2,1,"","json_serializer"],[8,2,1,"","load_json"],[8,2,1,"","save_json"],[8,2,1,"","value"]],"padl.dumptools.serialize.Serializer":[[8,4,1,"","save"],[8,4,1,"","save_all"],[8,3,1,"","varname"]],"padl.dumptools.sourceget":[[9,1,1,"","ReplaceString"],[9,1,1,"","ReplaceStrings"],[9,2,1,"","cut"],[9,2,1,"","get_module_source"],[9,2,1,"","get_source"],[9,2,1,"","original"],[9,2,1,"","put_into_cache"]],"padl.dumptools.sourceget.ReplaceString":[[9,4,1,"","cut"]],"padl.dumptools.sourceget.ReplaceStrings":[[9,4,1,"","cut"]],"padl.dumptools.symfinder":[[10,5,1,"","NameNotFound"],[10,1,1,"","Scope"],[10,1,1,"","ScopedName"],[10,2,1,"","find"],[10,2,1,"","find_in_ipython"],[10,2,1,"","find_in_module"],[10,2,1,"","find_in_scope"],[10,2,1,"","find_in_source"],[10,2,1,"","replace_star_imports"],[10,2,1,"","split_call"]],"padl.dumptools.symfinder.Scope":[[10,4,1,"","empty"],[10,4,1,"","from_level"],[10,4,1,"","from_source"],[10,4,1,"","global_"],[10,4,1,"","is_global"],[10,3,1,"","module_name"],[10,4,1,"","toplevel"],[10,4,1,"","unscoped"],[10,4,1,"","up"]],"padl.dumptools.var2mod":[[11,1,1,"","CodeGraph"],[11,1,1,"","CodeNode"],[11,1,1,"","Finder"],[11,1,1,"","Vars"],[11,2,1,"","find_codenode"],[11,2,1,"","find_globals"],[11,2,1,"","increment_same_name_var"],[11,2,1,"","rename"]],"padl.dumptools.var2mod.CodeGraph":[[11,4,1,"","build"],[11,4,1,"","dumps"],[11,4,1,"","print"]],"padl.dumptools.var2mod.CodeNode":[[11,4,1,"","from_source"]],"padl.dumptools.var2mod.Finder":[[11,4,1,"","find"],[11,4,1,"","generic_visit"],[11,4,1,"","get_source_segments"]],"padl.dumptools.var2mod.Vars":[[11,6,1,"","globals"],[11,6,1,"","locals"]],"padl.exceptions":[[12,5,1,"","WrongDeviceError"]],"padl.print_utils":[[13,2,1,"","combine_multi_line_strings"],[13,2,1,"","create_arrow"],[13,2,1,"","create_reverse_arrow"],[13,2,1,"","format_argument"],[13,2,1,"","make_bold"],[13,2,1,"","make_green"],[13,2,1,"","visible_len"]],"padl.transforms":[[14,1,1,"","AtomicTransform"],[14,1,1,"","Batchify"],[14,1,1,"","BuiltinTransform"],[14,1,1,"","ClassTransform"],[14,1,1,"","Compose"],[14,1,1,"","FunctionTransform"],[14,1,1,"","Identity"],[14,1,1,"","Map"],[14,1,1,"","Parallel"],[14,1,1,"","Pipeline"],[14,1,1,"","Rollout"],[14,1,1,"","TorchModuleTransform"],[14,1,1,"","Transform"],[14,1,1,"","Unbatchify"],[14,2,1,"","fulldump"],[14,2,1,"","group"],[14,2,1,"","importdump"],[14,2,1,"","load"],[14,2,1,"","save"]],"padl.transforms.ClassTransform":[[14,3,1,"","source"]],"padl.transforms.FunctionTransform":[[14,3,1,"","source"]],"padl.transforms.Pipeline":[[14,4,1,"","grouped"],[14,4,1,"","pd_forward_device_check"],[14,4,1,"","pd_to"]],"padl.transforms.TorchModuleTransform":[[14,4,1,"","post_load"],[14,4,1,"","pre_save"]],"padl.transforms.Transform":[[14,4,1,"","eval_apply"],[14,4,1,"","infer_apply"],[14,4,1,"","pd_call_in_mode"],[14,3,1,"","pd_device"],[14,3,1,"","pd_forward"],[14,4,1,"","pd_forward_device_check"],[14,4,1,"","pd_get_loader"],[14,3,1,"","pd_layers"],[14,3,1,"","pd_name"],[14,4,1,"","pd_parameters"],[14,4,1,"","pd_post_load"],[14,3,1,"","pd_postprocess"],[14,4,1,"","pd_pre_save"],[14,3,1,"","pd_preprocess"],[14,4,1,"","pd_save"],[14,3,1,"","pd_stages"],[14,4,1,"","pd_to"],[14,4,1,"","pd_varname"],[14,4,1,"","pd_zip_save"],[14,4,1,"","train_apply"]],"padl.util_transforms":[[15,1,1,"","IfEval"],[15,1,1,"","IfInMode"],[15,1,1,"","IfInfer"],[15,1,1,"","IfTrain"],[15,1,1,"","Try"]],"padl.utils":[[16,6,1,"","same"]],"padl.wrap":[[18,1,1,"","PatchedModule"],[18,2,1,"","transform"]],padl:[[3,1,1,"","Batchify"],[3,1,1,"","Identity"],[3,1,1,"","IfEval"],[3,1,1,"","IfInMode"],[3,1,1,"","IfInfer"],[3,1,1,"","IfTrain"],[3,1,1,"","Unbatchify"],[4,0,0,"-","dumptools"],[12,0,0,"-","exceptions"],[3,2,1,"","fulldump"],[3,2,1,"","group"],[3,2,1,"","importdump"],[3,2,1,"","load"],[13,0,0,"-","print_utils"],[3,2,1,"","save"],[3,2,1,"","transform"],[14,0,0,"-","transforms"],[3,7,1,"","unbatch"],[15,0,0,"-","util_transforms"],[16,0,0,"-","utils"],[3,2,1,"","value"],[17,0,0,"-","version"],[18,0,0,"-","wrap"]]},objnames:{"0":["py","module","Python module"],"1":["py","class","Python class"],"2":["py","function","Python function"],"3":["py","property","Python property"],"4":["py","method","Python method"],"5":["py","exception","Python exception"],"6":["py","attribute","Python attribute"],"7":["py","data","Python data"]},objtypes:{"0":"py:module","1":"py:class","2":"py:function","3":"py:property","4":"py:method","5":"py:exception","6":"py:attribute","7":"py:data"},terms:{"0":[0,3,6,9,10,11,14,25,26,27],"0x":11,"1":[0,2,3,9,10,11,14,15,23,25,26,27,28],"10":[0,3,15,24,25],"100":[2,11,23,24,26,27],"1000":24,"11":[3,6,15],"123":6,"13":9,"2":[0,3,9,10,11,14,23,25,26,27],"20":0,"200":26,"244":23,"3":[0,3,5,6,10,11,14,23,25,26],"300":26,"4":[11,25,26],"5":[9,25],"6":25,"7":[0,25],"8":[0,5,25],"9":[0,9,25],"99":[3,15],"abstract":[0,14,19,25,31],"case":[2,3,9,10,14,23],"catch":[15,21],"class":[2,3,5,6,8,9,10,11,14,15,18,24,25,30],"const":2,"default":[2,3,6,7,8,10,14,15,23],"do":[2,3,12,14,21,22,24],"final":[15,26],"function":[0,2,3,6,8,10,11,14,18,19,23,24,25,31],"import":[0,2,3,7,10,11,14,15,18,19,22,23,24,25,26,29,30],"int":[5,6,9,10,11,13,14],"new":[9,10],"return":[0,2,6,7,8,9,10,11,14,22,23,24,26,27,30],"switch":[2,3,14,25],"true":[3,7,9,10,11,13,14,18,23,25,27],"try":[3,6,9,14,15,18,21,26],"var":11,A:[3,6,9,10,11,14,31],As:[2,11,30],At:25,By:23,For:[2,23,24,25,26],If:[0,2,3,8,9,10,11,13,14,15],In:[3,9,10,14,23,24],It:[2,6,10,14,22,24,28],No:15,On:25,One:[2,23],The:[2,3,6,8,9,10,11,13,14,15,21,22,23,25,30,31],Then:25,These:[2,14],To:[2,3,9,14,22,23,30],With:31,_:2,____________:13,__call__:[2,24],__file__:2,__init__:[2,6,24],__main__:10,_ast:[10,11],_generatorwithlength:22,_pd_main:2,_thingfind:10,_trace_thi:6,a_transform:2,about:[6,14,25,28,31],abov:23,absolut:[2,25],accept:14,access:[10,27,30],ad:[3,10,14,22,31],adam:28,adapt:28,add:[2,3,9,14,24,26,27],add_n:2,addconst:2,addfirst:26,addit:9,advanc:19,after:[2,3,14,25,28],again:2,ai:[0,19],airplan:22,alia:11,all:[0,2,6,8,11,12,14,18,19,21,22,23,28,29],allow:[0,9,10,19,22,23,26],along:28,also:[2,3,14,22,24,26],alwai:14,am:25,an:[0,2,6,9,10,11,13,14,19,22,25,26,28,31],analog:26,ani:[3,8,13,14,15],anoth:13,anyth:[2,19],apach:0,api:19,append:[2,8],appli:[2,3,13,14,15,19,21,23,25,30],applic:26,ar:[2,3,8,10,11,14,21,22,23,24,25,28,29,30],arbitrari:[0,19,26],arg:[2,6,14,22,25,27],argument:[2,6,10,13,14,22],aris:23,arrai:[2,11,26],arrow:13,ascii:13,assign:[10,14],ast:[5,7,10,11],ast_nod:11,ast_util:[19,20],atom:14,atomictransform:[14,25],attribut:[6,9,16,25],augment:[23,26,28,30],automat:[2,3,14,22],avail:[6,22],awar:2,axxxxxxxxxxxxxxxxxxxx:9,b:[3,9,11,14,15],back:15,backward:28,bar:[11,22,23],base:[0,8,14,19],batch:[0,3,14,21,22,23,25,28,30,31],batch_siz:[22,25,28],batchifi:[3,10,14,21,25],baz:23,becaus:0,becom:[6,10,23,24],been:14,befor:[2,6,14,22],being:[3,14,26],below:[11,25],berlin:[0,19],between:[11,23],bia:25,big:2,bla:7,blip:7,blob:0,block:6,blop:7,blu:7,bodi:[2,6,7,10,11],boilerpl:31,bold:13,bool:[3,6,9,10,11,14],both:[2,9,28],build:[0,2,10,11,19,31],build_my_transform:2,builder:[0,19],built:28,builtin:14,builtintransform:14,bup:7,c:[3,14],cach:9,call:[3,6,8,10,11,14,15,24,25,30],call_info:14,call_sourc:10,callabl:[3,6,8,14,18,24],caller:6,caller_fram:6,caller_modul:6,callinfo:[6,14],calling_scop:10,can:[0,2,3,6,9,10,14,15,19,22,23,24,25,26,27,28,29,30,31],canb:22,cannot:2,capabl:28,captur:16,carri:15,cat:22,catch_transform:15,caus:2,caveat:2,cell:9,central:31,chang:[2,6,15],charact:13,check:[14,25],checkpoint:29,child:[12,14],child_transform:12,children:14,classifi:[23,30],classmethod:[8,10,11],classtransform:14,claus:15,clean:2,close:26,co:25,code:[0,2,3,6,7,8,9,10,11,14,25,28,31],code_of_conduct:0,codegraph:[8,11],codenod:11,col:[6,9,11],col_offset:5,collect:[9,14,21],column:6,com:0,combin:[13,14,19,21,24,31],combine_multi_line_str:13,come:[18,24],command:25,comment:6,common:23,complet:[6,15],complex:[2,14,27,31],compon:[0,19,23],compos:[14,25,27,30],composit:23,comprehens:0,compress:[3,14],concat_low:26,concis:[0,21],condit:[15,21],condition:23,conduct:0,conflict:2,consid:2,consist:2,consol:25,constant:[2,9],construct:14,contain:[2,6,8,9,10,12,13,14,28,29],content:11,context:[6,14],continu:[23,30],contrast:14,contribut:19,conveni:28,convert:[0,10,19,24,28,30],coor:13,coordin:13,correct:14,correspond:[5,10,11,30],could:[2,10,23],count:10,counter:[10,11],cpu:[3,14],creat:[0,2,6,8,10,11,13,14,19,21,22,23,28,29,31],create_arrow:13,create_reverse_arrow:13,crop:23,cuda:[14,28],current:[0,2,10,25],custom:[14,25,31],cut:9,d:25,data:[2,14,19,21,30,31],dataload:[14,22,31],datapoint:[14,23],dataset:2,debug:[11,19,21,31],debugg:25,decor:[3,14,18,24],deep:[0,2,19,23,30,31],deeper:25,def:[0,2,6,10,11,14,24,26,27,30],def_sourc:10,defin:[8,10,11,21,25,29,30],definit:2,depend:[2,11,29],detail:[6,14,23],determin:[3,6,9,11,14,18],develop:[0,19],devic:[3,12,14,22],di:31,diagnos:25,dict:9,dictionari:[2,14],differ:[2,9,22,25,30],dim:[3,14,25],dimens:[3,14,22,31],directli:14,directori:2,disabl:[3,13,14,22],displai:25,document:[6,14],doe:[14,22,25],doesn:[3,15],dog:22,don:[2,3,6,13,14,18],done:[14,22],down:[2,25],drop:[6,10],drop_n:[6,10],dump:[2,3,7,8,11,14],dump_packages_vers:7,dumptool:[14,19,20],dure:[3,14,23,26],e:[3,10,14],each:[2,14,22,25,30],easili:31,ecosystem:[0,19],edg:11,effect:2,either:[2,9],eleg:31,element:[14,23,25,30],elp:25,els:[3,11,15],else_:[3,15],else_transform:15,emb:25,embed:25,embedding_dim:25,empti:[6,10],enabl:[2,3,14,31],end:[3,11,13,14],end_col_offset:5,end_lineno:5,enter:[6,25],entir:[24,25],entiti:10,entri:2,enumer:2,epeat:25,equival:26,error:[15,25],escap:13,eval:[3,14,15,21,22,26],eval_appli:[3,14,15,22,25,26],evalu:30,even:23,event:6,everi:13,everyth:[11,21,23,24],exactli:23,exampl:[0,2,3,6,7,9,10,11,13,14,15,18,22,26,30],except:[10,15,19,20,21,25],execut:[0,2,6,23,25],exist:[3,11,14],expect:[2,3,9,14,22,25],explicit:[9,11],explicitli:14,extens:[3,14],extra:[15,19,21,28],extract:6,f1:14,f2:14,f:[2,9,10,11,14],factori:16,fail:[15,25],fall:15,fals:[3,6,10,11,13,14,18],few:2,field:11,file:[2,3,9,14,26,29],file_suffix:8,fileexistserror:[3,14],filenam:[2,9,14,26],filter_builtin:11,finally_transform:15,find:[0,7,10,11],find_codenod:11,find_glob:11,find_in_ipython:10,find_in_modul:10,find_in_scop:10,find_in_sourc:10,finder:11,finish_right:13,first:[3,6,9,13,14,23],flat:23,flatten:[3,14,23],flexibl:31,folder:[2,3,14,29],follow:[2,6,10,11,21,25],foo:[7,11,14,23],force_overwrit:[3,14],form:[10,14,24,31],formal:31,format:[7,13,30,31],format_argu:13,forward:[0,14,19,21,22,24,25],found:[6,10,11],four:10,frame:[6,9],frameinfo:6,from:[0,3,6,7,9,10,11,14,15,19,22,24,25,26,28,29,30],from_:11,from_col:9,from_level:10,from_lin:9,from_sourc:[10,11],front:6,full:[0,2,3,14],fulldump:[2,3,14],fulli:[3,14],functiontransform:14,fundament:14,futur:2,g:14,gener:[14,22],generic_visit:11,germani:[0,19],get:[2,5,6,7,9,10,11,13,14,16,19,21,23,25,26],get_module_sourc:9,get_packag:7,get_posit:5,get_segment_from_fram:6,get_sourc:9,get_source_seg:[5,11],get_stat:6,get_surrounding_block:6,get_vers:7,getitem:[6,27],github:0,give:9,given:[3,6,7,9,10,11,14],global:[2,10,11],global_:10,globals_:11,go:[0,11,25],good:14,got:25,gotten:9,gpu:[14,22,30,31],gradient:[14,22,31],graph:11,great:[0,19],green:13,group:[3,14,21],h:25,ha:[2,9,11,14,23,25,28,30],hacki:6,handl:22,happen:[15,30],have:[0,14,19,28],head:23,hello:26,help:[14,25],helper:[3,8],here:[2,6,25],hidden:24,hierarchi:10,histori:10,hood:22,how:[10,14,22,23,24,27,29,30,31],howev:2,http:0,i:[2,3,10,14,25],id:9,ident:[3,14,15,21,27],identifi:10,if_:[3,15],ifev:[3,15,21,26],iff:10,ifinf:[3,15,21,26],ifinmod:[3,15],iftrain:[3,15,21,23,26],ignor:14,ignore_grad:14,ignore_scop:[3,6,14,18],iim:[3,15],imag:[13,30],implement:[14,24],importdump:[2,3,14],in_featur:25,includ:[2,9,14,28,29],incorpor:25,increment:11,increment_same_name_var:11,indent:6,index:14,indic:[10,14],individu:23,infer:[3,14,15,21,22,26,28,30],infer_appli:[3,14,15,22,25,26],infer_pipelin:28,inform:[6,14,25],initi:[2,14,28],inlin:[6,14],innov:[0,19],input:[3,9,13,14,22,23,25,26],insert:9,insid:[15,25],inspect:[6,9,14,25,31],inspector:[14,19,20],instanc:[2,22,23,24,28],instead:[2,3,6,14,18],interact:[2,25,29,31],interest:0,intern:22,introduct:19,invers:[3,14],io:0,ipython:[2,9,10,27],is_glob:10,isinst:[9,11,18],issu:0,item:[0,3,10,14,16,22,26],iter:[14,22,28],its:[10,11,14,25],itself:6,jpg:22,json:[2,8],json_seri:8,just:[2,3,14],keep:23,kei:9,keyword:[0,14,19],know:21,kwarg:[6,14],l1:24,l2:24,lab:[0,19],lambda:[3,14,15,23,24,25,26],larg:2,larger:6,largest:6,last:[2,9,13,14],layer1:28,layer2:28,layer:[0,14,19,25],learn:[0,19,22,23,24,28,29,30,31],len:[2,22],length:[13,23],let:25,level:[2,6,10,23,25],lf1:[0,19],licens:19,like:[2,22,30],limit:2,lin:24,line:[6,9,10,13,25],linear:[0,24,25],lineno:[5,6,10,11],list:[2,3,7,9,10,11,13,14,15,22,25,26,28,29],liter:[3,6,14,15],live:11,load:[0,2,3,8,14,19,21,22,23,28,30],load_data:2,load_funct:8,load_imag:[23,30],load_json:8,loader:[8,14],loc:9,local:11,locat:[6,9],log10:24,longtensor:25,look:[0,2,6,10],lookup:[28,30],loop:[10,22,28],loss:[0,19,23,28],lower:26,lr:28,macro:23,made:[6,14],mai:[0,19],main:[0,10,12],maintain:9,make:[0,13,19,21,25,28],make_bold:13,make_green:13,manual:0,map:14,mark:[3,8,14],match:[3,6,12,14,15,25],math:24,md:0,mean:[2,3,14,23],messi:2,method:[6,14,21,26],might:[2,26],minim:31,minus100:24,minusx:[24,26,27],mlp:24,mml:24,mode:[3,14,15,22],model:[0,2,14,19,28,30],model_pass:23,modifi:9,modul:[3,6,7,8,9,10,11,14,18,19,21,23,24,27,29,30],module_nam:[6,10],more:[2,3,6,14,23,31],most:[10,23,30],mother:12,mother_transform:12,move:[3,14,23,25],mpiler:25,much:31,multi:[6,13,31],multipl:[2,14,22,24,28],multiprocess:14,must:[2,6,14,23],my:2,my_classifi:[22,30],my_classifier_transform:[23,30],my_pipelin:[0,2,28,29],myfil:2,myfunct:6,mykei:9,myload:2,mypipelin:29,mypytorchlay:28,mysav:2,mytransform:2,n:[6,10,11,14],n_final_row:13,n_in:24,n_initial_row:13,n_out:24,n_to_add:2,name:[2,3,6,7,10,11,14,15,30],namenotfound:10,natur:22,need:[2,8,14,19],nest:[10,27,28],never:14,next:[22,23,24,27,28,29,30,31],nextmodul:6,nn:[0,14,24,25],node:[5,7,10,11],nodetyp:11,nodevisitor:11,non:9,non_init_caller_frameinfo:6,none:[3,6,8,10,11,14,15,18],normal:[2,9,14],not_found:2,note:[2,6],notebook:[0,2,31],noth:[3,14,21],now:2,np:[2,11,18,24,26],nput:25,npy:2,nth:23,num_embed:25,num_work:[22,25,28],number:[6,10,11,13],numpi:[2,18,24],o:11,object:[6,9,10,11,14,22,26],occur:15,offset:[6,11],often:26,one:[2,3,10,13,14,15,23,25,30],onli:[2,11,23,26],open:[2,23,26],open_fil:26,oper:23,optim:28,option:[3,6,8,11,14,15],order:14,ordereddict:14,origin:[6,9],other:[14,15],otherwis:[3,14,15],out:[6,9,10,11,15,18,23,24],out_featur:25,outer:6,outer_caller_frameinfo:6,output:[3,14,15,22,23,30],over:[13,14,23,28],overlap:9,overrid:14,overwrit:[3,14],own:[2,25],p:25,packag:[0,2,3,7,14,19,25,29],packagefind:[19,20],pad:13,padl:[2,20,23,24,25,26,27,29,30,31],padl_value_0:2,page:21,parallel:[3,14],param:14,paramet:[2,3,6,7,8,9,10,11,12,13,14,15,18,29],parent:[2,18],parenthes:23,pars:[7,11],part:[9,14,21,22,25,30],parti:2,particular:24,pass:[0,2,3,14,19,22],patch:18,patchedmodul:18,path:[2,3,8,14,23,30],pathlib:[2,3,8,14],pd_call_in_mod:14,pd_debug:[21,25],pd_devic:14,pd_forward:[14,22,30],pd_forward_device_check:14,pd_get_load:14,pd_group:14,pd_layer:[14,28],pd_name:[14,15],pd_np:18,pd_paramet:[14,28],pd_post_load:14,pd_postprocess:[14,30],pd_pre_sav:14,pd_preprocess:[14,30],pd_save:14,pd_stage:14,pd_to:[14,28],pd_varnam:14,pd_zip_sav:14,perform:[3,14,15],pick:2,piec:[10,11],pil:23,piltotensor:23,pip:0,pipelin:[0,14,19,21,22,24,25,27,28,29,30],pleas:0,pluson:2,plustwo:2,posit:[5,9,11,25],possibl:[2,6,14,24,28],post:[0,14,19,30],post_load:14,postprocess:[3,14,19,21,22,23,25],potenti:[2,6],power:23,pre:[0,9,14,19,30],pre_sav:14,preced:13,predict:[23,28],prefer:0,prepar:0,preprocess:[3,14,19,21,22,23,25,28,31],preprocess_imag:23,pretti:27,prevent:[2,3,14],previous:2,print:[6,11,13,14,19,21,25,29],print_util:[19,20],process:[0,2,14,19,22,30,31],produc:25,progress:22,propag:14,properti:[6,8,10,14],provid:[2,23,25],pt:2,put:9,put_into_cach:9,py:[2,29],pypi:2,python:[0,2,5,6,10,11,19,23,24,29],pytorch:[0,14,19,21,22,23,24,27,29,30],q:25,quit:25,r:25,rais:[3,6,14,25],rand:18,random:18,randomresizedcrop:23,randomrot:23,rang:2,ransform:25,rather:[2,6,14],re:[0,19,23],reach:25,read:[2,21,22,26,27,31],read_from_path:26,readabl:30,recent:10,recreat:2,recurs:[3,14,25],ref:25,refer:21,regardless:15,relev:25,relu:24,rememb:28,remov:[3,6,14,22],renam:[2,11],rename_loc:11,repeat:[2,23,25],repl:9,replac:[9,10],replace_cach:9,replace_star_import:10,replacestr:9,repres:[10,11],reproduc:31,requir:[2,6],reshap:30,resiz:23,resnet18:[23,30],respect:[3,11,14,26],respons:[2,30],rest:6,result:[2,3,6,9,14,23],retriev:25,return_loc:6,return_parti:10,revers:2,roll:23,rollout:[3,14],row:6,rstring:9,run:25,runtimeerror:25,s:[3,6,7,8,9,10,14,15,21,22,24,28,29,30],same:[3,5,6,9,10,11,14,16,21,23,25,28],save:[1,3,8,14,19,21,22,31],save_al:8,save_funct:8,save_json:8,saver:8,scope:[3,6,10,11,14,18],scoped_nam:11,scopednam:[10,11],scopelist:10,search:[10,11,14],second:[2,3,10,14,23],section:[9,22,23,24,27,28,29,30,31],see:[0,2,3,6,14,22],segment:[5,6,10,11],segment_typ:6,self:[2,10,14,24],send:[14,22,28,31],sequenc:[13,14,23],seri:14,serial:[3,14,19,20],session:[2,29],set:[2,8,11,14,22],settrac:6,shape:25,should:[2,3,6,8,14],show:[22,25],shown:25,similar:2,simpli:[2,14],sin:24,sinc:25,singl:[0,14,19,22,23],size:[22,25],slice:[19,21,29,31],slower:0,so:[10,23,25],some:[2,23,25,28],somemodul:11,someobject:2,someth:[2,26],sometim:2,soon:6,sourc:[5,6,7,9,10,11,14],sourceget:[19,20],space:[6,13],special:[23,26,30],specifi:[3,9,10,14,22],split:[2,10],split_cal:10,stack:6,stage:[14,19,21,22,23,25],stand:30,standard:[0,19],star:[2,10],start:[3,10,13,14,19,21,25],start_left:13,state_dict:28,statement:[2,3,6,10,14,15,25],step:[14,23,28],stop:31,store:[2,3,8,28,29],str:[2,3,6,8,9,10,11,13,14,15],string:[3,7,8,9,10,11,13,14],sub:[9,11,14,23,27],subclass:10,substr:9,subval:2,successfulli:15,suffix:2,suggest:30,superimpos:13,support:[0,2,22],surround:[6,10],sy:6,symbol:[2,10],symfind:[6,11,19,20],t1:[14,23,27],t2:[14,23,27],t3:[14,23,27],t4:27,t5:27,t:[2,3,6,13,14,15,18,23,25,26],take:[13,23],taken:[9,24],target:[6,23],target_mod:[3,15],tensor:[0,3,14,22],text:[0,2],textcorpu:2,than:2,them:[2,3,14,21,23,28],thereof:[3,14],thi:[2,3,6,9,10,11,13,14,15,22,23,24,25,27,28,29],thing:[2,3,8,9,10,11],third:2,those:[2,11,28,30],three:[22,23],through:[11,22,23],thu:[2,23],time:2,to_col:9,to_lin:9,to_tensor:25,toarrai:2,togeth:27,too:[24,27,29],top:[10,13,25],topic:19,topk:0,toplevel:[3,6,10,14,18],topolog:[0,19],torch:[0,14,24,25,28],torchmoduletransform:14,torchvis:[23,30],totensor:[23,30],tqdm:22,trace:6,trace_thi:6,tracefunc:6,track:2,train:[3,14,15,21,22,26,28,30],train_appli:[14,22,25,28],train_data:28,train_model:28,train_pipelin:28,training_pipelin:23,transform:[0,3,10,12,15,16,18,19,20,21,27,29,30],transform_or_modul:[3,14],transpar:[13,31],tree:[0,10,11],tupl:[2,3,6,10,11,14,15,23],turn:14,tvt:23,two:2,txt:[2,29],type:[6,11],typic:14,u:25,uit:25,unbatch:[0,3,21,23,30],unbatchifi:[3,14],under:[0,22],undo:2,unind:6,union:[3,14,15],uniqu:14,unscop:10,unsqueez:[3,14],until:25,up:[2,10,25],updat:22,us:[0,2,3,6,7,8,9,10,11,13,14,15,18,19,21,22,23,24,25,26,27,30,31],usag:[0,19],use_replace_cach:9,user:[0,19,25],usual:30,util:[6,7,13,14,19,20,23,28],util_transform:[19,20],v:13,val:[2,3,8],valu:[3,8,9,10,13,21],valueerror:6,var2mod:[19,20],var_nam:10,variabl:[10,11,14,25],variou:[9,10],varnam:[8,10],veri:2,version:[0,2,7,9,10,14,19,20,29],via:[2,14,27,28,29,30],view:23,visibl:13,visible_len:13,visitor:11,w:25,wa:[0,6,14,19,25],wai:[10,25],want:[2,26],we:[2,25,30],well:10,were:[2,10],what:[14,26,30],whatev:14,when:[2,3,14,15,24,25,28,29],where:[6,9,11,13,25],wherea:30,which:[2,3,6,9,10,11,14,22,23,29],whole:[14,31],whose:[3,14],wide:6,within:[6,9,10,14,28],without:31,word:2,word_index:2,wordindex:2,work:[27,28,31],worker:22,workflow:[30,31],worri:31,would:[2,9,10,23],wrap:[2,3,14,19,20,24],wrappe:[3,18],wrapper:[3,18,24],write:[0,2,3,14,19],written:10,wrongdeviceerror:12,x1:14,x2:14,x3:14,x:[0,2,3,9,10,11,13,14,15,23,24,25,26,27,30],xxxx:9,xxxxxaxxxxxxxxxxxxxxxxxxxx:9,xxxxxxxxxxx:9,xxxxxxxxxxxxxb:9,xxxxxxxxxxxxxbxxxx:9,y:[11,13,23,24,27],you:[0,2,19,23,26,31],your:[2,19,21,31],z:[11,23],zero_grad:28,zip:[3,14]},titles:["Introduction","Advanced Topics","Saving","<code class=\"docutils literal notranslate\"><span class=\"pre\">padl</span></code>","<code class=\"docutils literal notranslate\"><span class=\"pre\">padl.dumptools</span></code>","<code class=\"docutils literal notranslate\"><span class=\"pre\">padl.dumptools.ast_utils</span></code>","<code class=\"docutils literal notranslate\"><span class=\"pre\">padl.dumptools.inspector</span></code>","<code class=\"docutils literal notranslate\"><span class=\"pre\">padl.dumptools.packagefinder</span></code>","<code class=\"docutils literal notranslate\"><span class=\"pre\">padl.dumptools.serialize</span></code>","<code class=\"docutils literal notranslate\"><span class=\"pre\">padl.dumptools.sourceget</span></code>","<code class=\"docutils literal notranslate\"><span class=\"pre\">padl.dumptools.symfinder</span></code>","<code class=\"docutils literal notranslate\"><span class=\"pre\">padl.dumptools.var2mod</span></code>","<code class=\"docutils literal notranslate\"><span class=\"pre\">padl.exceptions</span></code>","<code class=\"docutils literal notranslate\"><span class=\"pre\">padl.print_utils</span></code>","<code class=\"docutils literal notranslate\"><span class=\"pre\">padl.transforms</span></code>","<code class=\"docutils literal notranslate\"><span class=\"pre\">padl.util_transforms</span></code>","<code class=\"docutils literal notranslate\"><span class=\"pre\">padl.utils</span></code>","<code class=\"docutils literal notranslate\"><span class=\"pre\">padl.version</span></code>","<code class=\"docutils literal notranslate\"><span class=\"pre\">padl.wrap</span></code>","Welcome to PADL\u2019s documentation!","API Documentation","Usage","Applying Transforms to Data","Combining Transforms into Pipelines","Creating Transforms","Debugging your Transforms","Extras","Printing and Slicing","Using PyTorch Modules with Transforms","Saving and Loading","Stages: Preprocess, Forward and Postprocess","<em>Transforms</em> and <em>Pipelines</em>"],titleterms:{"import":21,The:26,access:28,advanc:1,an:23,anyth:21,api:20,appli:[22,26],ast_util:5,automat:28,block:2,build:23,combin:23,compos:23,content:[1,19,20,21],contribut:0,convert:23,creat:24,custom:2,data:22,debug:25,defin:2,depend:26,devic:28,dict:28,dictionari:23,differ:23,document:[19,20],doe:2,dumptool:[4,5,6,7,8,9,10,11],exampl:[23,25],except:[12,26],extra:26,extract:23,first:0,forward:[23,30],from:[2,21,23],gener:23,get:0,group:23,handl:26,how:2,imag:23,inspector:6,instal:0,introduct:0,item:23,layer:28,licens:0,load:29,loop:2,map:23,mode:26,model:23,modul:[2,28],multipl:23,mutat:2,need:21,nest:2,object:2,other:2,packagefind:7,padl:[0,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,21,28],parallel:23,paramet:28,pass:23,pipelin:[23,31],post:23,postprocess:30,pre:23,preprocess:30,print:27,print_util:13,process:23,program:0,pytorch:[2,28],resourc:0,rollout:23,s:19,same:26,sampl:23,save:[2,28,29],scope:2,serial:[2,8],share:28,slice:27,sourceget:9,stage:30,start:0,state:28,symfind:10,target:2,tensor:23,topic:1,train:23,transform:[2,14,22,23,24,25,26,28,31],us:28,usag:21,util:[16,26],util_transform:15,valu:2,var2mod:11,variabl:2,version:[17,23],weight:28,welcom:19,what:2,within:2,work:2,wrap:18,you:21,your:[0,25]}})
\ No newline at end of file
diff --git a/docs/unstable/usage.html b/docs/unstable/usage.html
index 54265ae0..1b35bfa5 100644
--- a/docs/unstable/usage.html
+++ b/docs/unstable/usage.html
@@ -95,6 +95,10 @@
 <li class="toctree-l3"><a class="reference internal" href="usage/pytorch.html#weight-sharing">Weight Sharing</a></li>
 </ul>
 </li>
+<li class="toctree-l2"><a class="reference internal" href="usage/debugging_your_transforms.html">Debugging your Transforms</a><ul>
+<li class="toctree-l3"><a class="reference internal" href="usage/debugging_your_transforms.html#example">Example</a></li>
+</ul>
+</li>
 <li class="toctree-l2"><a class="reference internal" href="usage/extras.html">Extras</a><ul>
 <li class="toctree-l3"><a class="reference internal" href="usage/extras.html#the-same-utility">The <code class="xref py py-obj docutils literal notranslate"><span class="pre">same</span></code> Utility</a></li>
 <li class="toctree-l3"><a class="reference internal" href="usage/extras.html#applying-transforms-depending-on-the-mode">Applying Transforms Depending on the Mode</a></li>
@@ -183,6 +187,7 @@ <h1>Usage<a class="headerlink" href="#usage" title="Permalink to this headline">
 <li class="toctree-l1"><a class="reference internal" href="usage/saving.html">Saving and Loading</a></li>
 <li class="toctree-l1"><a class="reference internal" href="usage/print_slice.html">Printing and Slicing</a></li>
 <li class="toctree-l1"><a class="reference internal" href="usage/pytorch.html">Using PyTorch Modules with Transforms</a></li>
+<li class="toctree-l1"><a class="reference internal" href="usage/debugging_your_transforms.html">Debugging your Transforms</a></li>
 <li class="toctree-l1"><a class="reference internal" href="usage/extras.html">Extras</a></li>
 </ul>
 </div>
@@ -201,7 +206,8 @@ <h2>Import anything you need <code class="docutils literal notranslate"><span cl
 <li><p><a class="reference internal" href="apidocs/padl.html#padl.IfInfer" title="padl.IfInfer"><code class="xref py py-class docutils literal notranslate"><span class="pre">IfInfer</span></code></a> for conditioning on the ‘infer’-stage.</p></li>
 <li><p><a class="reference internal" href="apidocs/padl.html#padl.IfEval" title="padl.IfEval"><code class="xref py py-class docutils literal notranslate"><span class="pre">IfEval</span></code></a> for conditioning on the ‘eval’-stage.</p></li>
 <li><p><a class="reference internal" href="apidocs/padl.html#padl.IfTrain" title="padl.IfTrain"><code class="xref py py-class docutils literal notranslate"><span class="pre">IfTrain</span></code></a> for conditioning on the ‘train’-stage.</p></li>
-<li><p><code class="xref py py-class docutils literal notranslate"><span class="pre">Try</span></code> for catching exceptions in a transform.</p></li>
+<li><p><code class="xref py py-class docutils literal notranslate"><span class="pre">Try</span></code> for catching exceptions in a Transform.</p></li>
+<li><p><code class="xref py py-class docutils literal notranslate"><span class="pre">pd_debug</span></code> for debugging Transforms.</p></li>
 </ul>
 </section>
 </section>
diff --git a/docs/unstable/usage/apply.html b/docs/unstable/usage/apply.html
index 5e670210..10ad0750 100644
--- a/docs/unstable/usage/apply.html
+++ b/docs/unstable/usage/apply.html
@@ -95,6 +95,10 @@
 <li class="toctree-l3"><a class="reference internal" href="pytorch.html#weight-sharing">Weight Sharing</a></li>
 </ul>
 </li>
+<li class="toctree-l2"><a class="reference internal" href="debugging_your_transforms.html">Debugging your Transforms</a><ul>
+<li class="toctree-l3"><a class="reference internal" href="debugging_your_transforms.html#example">Example</a></li>
+</ul>
+</li>
 <li class="toctree-l2"><a class="reference internal" href="extras.html">Extras</a><ul>
 <li class="toctree-l3"><a class="reference internal" href="extras.html#the-same-utility">The <code class="xref py py-obj docutils literal notranslate"><span class="pre">same</span></code> Utility</a></li>
 <li class="toctree-l3"><a class="reference internal" href="extras.html#applying-transforms-depending-on-the-mode">Applying Transforms Depending on the Mode</a></li>
diff --git a/docs/unstable/usage/combining_transforms.html b/docs/unstable/usage/combining_transforms.html
index d37e0ef5..dd19b2b7 100644
--- a/docs/unstable/usage/combining_transforms.html
+++ b/docs/unstable/usage/combining_transforms.html
@@ -95,6 +95,10 @@
 <li class="toctree-l3"><a class="reference internal" href="pytorch.html#weight-sharing">Weight Sharing</a></li>
 </ul>
 </li>
+<li class="toctree-l2"><a class="reference internal" href="debugging_your_transforms.html">Debugging your Transforms</a><ul>
+<li class="toctree-l3"><a class="reference internal" href="debugging_your_transforms.html#example">Example</a></li>
+</ul>
+</li>
 <li class="toctree-l2"><a class="reference internal" href="extras.html">Extras</a><ul>
 <li class="toctree-l3"><a class="reference internal" href="extras.html#the-same-utility">The <code class="xref py py-obj docutils literal notranslate"><span class="pre">same</span></code> Utility</a></li>
 <li class="toctree-l3"><a class="reference internal" href="extras.html#applying-transforms-depending-on-the-mode">Applying Transforms Depending on the Mode</a></li>
diff --git a/docs/unstable/usage/creating_transforms.html b/docs/unstable/usage/creating_transforms.html
index b3585f2c..c681f749 100644
--- a/docs/unstable/usage/creating_transforms.html
+++ b/docs/unstable/usage/creating_transforms.html
@@ -95,6 +95,10 @@
 <li class="toctree-l3"><a class="reference internal" href="pytorch.html#weight-sharing">Weight Sharing</a></li>
 </ul>
 </li>
+<li class="toctree-l2"><a class="reference internal" href="debugging_your_transforms.html">Debugging your Transforms</a><ul>
+<li class="toctree-l3"><a class="reference internal" href="debugging_your_transforms.html#example">Example</a></li>
+</ul>
+</li>
 <li class="toctree-l2"><a class="reference internal" href="extras.html">Extras</a><ul>
 <li class="toctree-l3"><a class="reference internal" href="extras.html#the-same-utility">The <code class="xref py py-obj docutils literal notranslate"><span class="pre">same</span></code> Utility</a></li>
 <li class="toctree-l3"><a class="reference internal" href="extras.html#applying-transforms-depending-on-the-mode">Applying Transforms Depending on the Mode</a></li>
diff --git a/docs/unstable/usage/debugging_your_transforms.html b/docs/unstable/usage/debugging_your_transforms.html
new file mode 100644
index 00000000..c3da59b0
--- /dev/null
+++ b/docs/unstable/usage/debugging_your_transforms.html
@@ -0,0 +1,367 @@
+<!DOCTYPE html>
+<html class="writer-html5" lang="en" >
+<head>
+  <meta charset="utf-8" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" />
+
+  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+  <title>Debugging your Transforms &mdash; PADL 0.1.0 documentation</title>
+      <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
+      <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" />
+      <link rel="stylesheet" href="../_static/custom.css" type="text/css" />
+  <!--[if lt IE 9]>
+    <script src="../_static/js/html5shiv.min.js"></script>
+  <![endif]-->
+  
+        <script data-url_root="../" id="documentation_options" src="../_static/documentation_options.js"></script>
+        <script src="../_static/jquery.js"></script>
+        <script src="../_static/underscore.js"></script>
+        <script src="../_static/doctools.js"></script>
+    <script src="../_static/js/theme.js"></script>
+    <link rel="index" title="Index" href="../genindex.html" />
+    <link rel="search" title="Search" href="../search.html" />
+    <link rel="next" title="Extras" href="extras.html" />
+    <link rel="prev" title="Using PyTorch Modules with Transforms" href="pytorch.html" /> 
+</head>
+
+<body class="wy-body-for-nav"> 
+  <div class="wy-grid-for-nav">
+    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
+      <div class="wy-side-scroll">
+        <div class="wy-side-nav-search" >
+            <a href="../index.html">
+            <img src="../_static/padl-logo.png" class="logo" alt="Logo"/>
+          </a>
+<div role="search">
+  <form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
+    <input type="text" name="q" placeholder="Search docs" />
+    <input type="hidden" name="check_keywords" value="yes" />
+    <input type="hidden" name="area" value="default" />
+  </form>
+</div>
+        </div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
+              <p class="caption" role="heading"><span class="caption-text">Contents:</span></p>
+<ul class="current">
+<li class="toctree-l1"><a class="reference internal" href="../README.html">Introduction</a><ul>
+<li class="toctree-l2"><a class="reference internal" href="../README.html#getting-started">Getting Started</a><ul>
+<li class="toctree-l3"><a class="reference internal" href="../README.html#installation">Installation</a></li>
+<li class="toctree-l3"><a class="reference internal" href="../README.html#your-first-padl-program">Your first PADL program</a></li>
+<li class="toctree-l3"><a class="reference internal" href="../README.html#resources">Resources</a></li>
+</ul>
+</li>
+<li class="toctree-l2"><a class="reference internal" href="../README.html#contributing">Contributing</a></li>
+<li class="toctree-l2"><a class="reference internal" href="../README.html#licensing">Licensing</a></li>
+</ul>
+</li>
+<li class="toctree-l1 current"><a class="reference internal" href="../usage.html">Usage</a><ul class="current">
+<li class="toctree-l2"><a class="reference internal" href="transform.html"><em>Transforms</em> and <em>Pipelines</em></a></li>
+<li class="toctree-l2"><a class="reference internal" href="creating_transforms.html">Creating Transforms</a></li>
+<li class="toctree-l2"><a class="reference internal" href="combining_transforms.html">Combining Transforms into Pipelines</a><ul>
+<li class="toctree-l3"><a class="reference internal" href="combining_transforms.html#compose">Compose <code class="docutils literal notranslate"><span class="pre">&gt;&gt;</span></code></a></li>
+<li class="toctree-l3"><a class="reference internal" href="combining_transforms.html#rollout">Rollout <code class="docutils literal notranslate"><span class="pre">+</span></code></a></li>
+<li class="toctree-l3"><a class="reference internal" href="combining_transforms.html#parallel">Parallel <code class="docutils literal notranslate"><span class="pre">/</span></code></a></li>
+<li class="toctree-l3"><a class="reference internal" href="combining_transforms.html#map">Map <code class="docutils literal notranslate"><span class="pre">~</span></code></a></li>
+<li class="toctree-l3"><a class="reference internal" href="combining_transforms.html#grouping-transforms">Grouping Transforms</a></li>
+<li class="toctree-l3"><a class="reference internal" href="combining_transforms.html#examples">Examples</a><ul>
+<li class="toctree-l4"><a class="reference internal" href="combining_transforms.html#id2">Compose</a><ul>
+<li class="toctree-l5"><a class="reference internal" href="combining_transforms.html#building-pre-processing-pipelines">Building pre-processing pipelines</a></li>
+<li class="toctree-l5"><a class="reference internal" href="combining_transforms.html#combining-pre-processing-model-forward-pass-and-post-processing">Combining pre-processing, model forward pass and post-processing</a></li>
+</ul>
+</li>
+<li class="toctree-l4"><a class="reference internal" href="combining_transforms.html#id3">Rollout</a><ul>
+<li class="toctree-l5"><a class="reference internal" href="combining_transforms.html#extracting-items-from-a-dictionary">Extracting items from a dictionary</a></li>
+<li class="toctree-l5"><a class="reference internal" href="combining_transforms.html#generating-different-versions-of-an-image">Generating different versions of an image</a></li>
+</ul>
+</li>
+<li class="toctree-l4"><a class="reference internal" href="combining_transforms.html#id4">Parallel</a><ul>
+<li class="toctree-l5"><a class="reference internal" href="combining_transforms.html#pass-training-samples">Pass training samples</a></li>
+</ul>
+</li>
+<li class="toctree-l4"><a class="reference internal" href="combining_transforms.html#id5">Map</a><ul>
+<li class="toctree-l5"><a class="reference internal" href="combining_transforms.html#example-convert-multiple-images-to-tensors">Example: convert multiple images to tensors</a></li>
+</ul>
+</li>
+</ul>
+</li>
+</ul>
+</li>
+<li class="toctree-l2"><a class="reference internal" href="stages.html">Stages: Preprocess, Forward and Postprocess</a></li>
+<li class="toctree-l2"><a class="reference internal" href="apply.html">Applying Transforms to Data</a></li>
+<li class="toctree-l2"><a class="reference internal" href="saving.html">Saving and Loading</a></li>
+<li class="toctree-l2"><a class="reference internal" href="print_slice.html">Printing and Slicing</a></li>
+<li class="toctree-l2"><a class="reference internal" href="pytorch.html">Using PyTorch Modules with Transforms</a><ul>
+<li class="toctree-l3"><a class="reference internal" href="pytorch.html#padl-automatically-saves-pytorch-state-dicts">PADL Automatically Saves PyTorch State-Dicts</a></li>
+<li class="toctree-l3"><a class="reference internal" href="pytorch.html#devices">Devices</a></li>
+<li class="toctree-l3"><a class="reference internal" href="pytorch.html#accessing-layers-and-parameters">Accessing Layers and Parameters</a></li>
+<li class="toctree-l3"><a class="reference internal" href="pytorch.html#weight-sharing">Weight Sharing</a></li>
+</ul>
+</li>
+<li class="toctree-l2 current"><a class="current reference internal" href="#">Debugging your Transforms</a><ul>
+<li class="toctree-l3"><a class="reference internal" href="#example">Example</a></li>
+</ul>
+</li>
+<li class="toctree-l2"><a class="reference internal" href="extras.html">Extras</a><ul>
+<li class="toctree-l3"><a class="reference internal" href="extras.html#the-same-utility">The <code class="xref py py-obj docutils literal notranslate"><span class="pre">same</span></code> Utility</a></li>
+<li class="toctree-l3"><a class="reference internal" href="extras.html#applying-transforms-depending-on-the-mode">Applying Transforms Depending on the Mode</a></li>
+<li class="toctree-l3"><a class="reference internal" href="extras.html#exception-handling">Exception Handling</a></li>
+</ul>
+</li>
+<li class="toctree-l2"><a class="reference internal" href="../usage.html#import-anything-you-need-from-padl">Import anything you need <code class="docutils literal notranslate"><span class="pre">from</span> <span class="pre">padl</span></code></a></li>
+</ul>
+</li>
+<li class="toctree-l1"><a class="reference internal" href="../advanced.html">Advanced Topics</a><ul>
+<li class="toctree-l2"><a class="reference internal" href="../advanced/saving.html">Saving</a><ul>
+<li class="toctree-l3"><a class="reference internal" href="../advanced/saving.html#how-it-works">How it works</a></li>
+<li class="toctree-l3"><a class="reference internal" href="../advanced/saving.html#saving-by-value">Saving by value</a><ul>
+<li class="toctree-l4"><a class="reference internal" href="../advanced/saving.html#custom-serializers">Custom serializers</a></li>
+</ul>
+</li>
+<li class="toctree-l3"><a class="reference internal" href="../advanced/saving.html#saving-pytorch-modules">Saving pytorch modules</a></li>
+<li class="toctree-l3"><a class="reference internal" href="../advanced/saving.html#defining-transform-within-nested-scopes">Defining Transform within nested scopes</a></li>
+<li class="toctree-l3"><a class="reference internal" href="../advanced/saving.html#saving-transforms-from-other-modules">Saving Transforms from other modules</a></li>
+<li class="toctree-l3"><a class="reference internal" href="../advanced/saving.html#id2">What does not save</a><ul>
+<li class="toctree-l4"><a class="reference internal" href="../advanced/saving.html#variables-defined-as-the-targets-of-with-blocks">Variables defined as the targets of <code class="code docutils literal notranslate"><span class="pre">with</span></code> blocks</a></li>
+<li class="toctree-l4"><a class="reference internal" href="../advanced/saving.html#variables-defined-as-targets-of-loops">Variables defined as targets of loops</a></li>
+<li class="toctree-l4"><a class="reference internal" href="../advanced/saving.html#mutated-objects">Mutated objects</a></li>
+</ul>
+</li>
+</ul>
+</li>
+</ul>
+</li>
+<li class="toctree-l1"><a class="reference internal" href="../modules.html">API Documentation</a><ul>
+<li class="toctree-l2"><a class="reference internal" href="../apidocs/padl.html"><code class="docutils literal notranslate"><span class="pre">padl</span></code></a></li>
+<li class="toctree-l2"><a class="reference internal" href="../apidocs/padl.dumptools.html"><code class="docutils literal notranslate"><span class="pre">padl.dumptools</span></code></a></li>
+<li class="toctree-l2"><a class="reference internal" href="../apidocs/padl.dumptools.ast_utils.html"><code class="docutils literal notranslate"><span class="pre">padl.dumptools.ast_utils</span></code></a></li>
+<li class="toctree-l2"><a class="reference internal" href="../apidocs/padl.dumptools.inspector.html"><code class="docutils literal notranslate"><span class="pre">padl.dumptools.inspector</span></code></a></li>
+<li class="toctree-l2"><a class="reference internal" href="../apidocs/padl.dumptools.packagefinder.html"><code class="docutils literal notranslate"><span class="pre">padl.dumptools.packagefinder</span></code></a></li>
+<li class="toctree-l2"><a class="reference internal" href="../apidocs/padl.dumptools.serialize.html"><code class="docutils literal notranslate"><span class="pre">padl.dumptools.serialize</span></code></a></li>
+<li class="toctree-l2"><a class="reference internal" href="../apidocs/padl.dumptools.sourceget.html"><code class="docutils literal notranslate"><span class="pre">padl.dumptools.sourceget</span></code></a></li>
+<li class="toctree-l2"><a class="reference internal" href="../apidocs/padl.dumptools.symfinder.html"><code class="docutils literal notranslate"><span class="pre">padl.dumptools.symfinder</span></code></a></li>
+<li class="toctree-l2"><a class="reference internal" href="../apidocs/padl.dumptools.var2mod.html"><code class="docutils literal notranslate"><span class="pre">padl.dumptools.var2mod</span></code></a></li>
+<li class="toctree-l2"><a class="reference internal" href="../apidocs/padl.exceptions.html"><code class="docutils literal notranslate"><span class="pre">padl.exceptions</span></code></a></li>
+<li class="toctree-l2"><a class="reference internal" href="../apidocs/padl.print_utils.html"><code class="docutils literal notranslate"><span class="pre">padl.print_utils</span></code></a></li>
+<li class="toctree-l2"><a class="reference internal" href="../apidocs/padl.transforms.html"><code class="docutils literal notranslate"><span class="pre">padl.transforms</span></code></a></li>
+<li class="toctree-l2"><a class="reference internal" href="../apidocs/padl.util_transforms.html"><code class="docutils literal notranslate"><span class="pre">padl.util_transforms</span></code></a></li>
+<li class="toctree-l2"><a class="reference internal" href="../apidocs/padl.utils.html"><code class="docutils literal notranslate"><span class="pre">padl.utils</span></code></a></li>
+<li class="toctree-l2"><a class="reference internal" href="../apidocs/padl.version.html"><code class="docutils literal notranslate"><span class="pre">padl.version</span></code></a></li>
+<li class="toctree-l2"><a class="reference internal" href="../apidocs/padl.wrap.html"><code class="docutils literal notranslate"><span class="pre">padl.wrap</span></code></a></li>
+</ul>
+</li>
+</ul>
+
+        </div>
+      </div>
+    </nav>
+
+    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
+          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
+          <a href="../index.html">PADL</a>
+      </nav>
+
+      <div class="wy-nav-content">
+        <div class="rst-content">
+          <div role="navigation" aria-label="Page navigation">
+  <ul class="wy-breadcrumbs">
+      <li><a href="../index.html" class="icon icon-home"></a> &raquo;</li>
+          <li><a href="../usage.html">Usage</a> &raquo;</li>
+      <li>Debugging your Transforms</li>
+      <li class="wy-breadcrumbs-aside">
+      </li>
+  </ul>
+  <hr/>
+</div>
+          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
+           <div itemprop="articleBody">
+             
+  <section id="id1">
+<h1>Debugging your Transforms<a class="headerlink" href="#id1" title="Permalink to this headline"></a></h1>
+<p>PADL provides a customized debugger to inspect and diagnose errors raised when applying a
+<a class="reference internal" href="../apidocs/padl.transforms.html#padl.transforms.Pipeline" title="padl.transforms.Pipeline"><code class="xref py py-class docutils literal notranslate"><span class="pre">Pipeline</span></code></a>.</p>
+<p>For using this functionality, call <code class="xref py py-obj docutils literal notranslate"><span class="pre">pd_debug</span></code> after the execution failed, such as</p>
+<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="c1"># train_apply, eval_apply or infer_apply that produced a RuntimeError</span>
+
+<span class="kn">from</span> <span class="nn">padl</span> <span class="kn">import</span> <span class="n">pd_debug</span>
+
+<span class="n">pd_debug</span><span class="p">()</span>
+</pre></div>
+</div>
+<p>This way, we get a debugger where we can interact with the different parts of the
+<a class="reference internal" href="../apidocs/padl.transforms.html#padl.transforms.Pipeline" title="padl.transforms.Pipeline"><code class="xref py py-class docutils literal notranslate"><span class="pre">Pipeline</span></code></a> and inspect relevant information on each level.</p>
+<p>The debugger console has defined the following commands:</p>
+<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>* u(p): go one abstraction level up on the {class}`~padl.transforms.Pipeline`.
+* d(own): go one abstraction level down on the {class}`~padl.transforms.Pipeline`.
+* w(here am I?): show code position where the {class}`~padl.transforms.Transform` was defined.
+* i(nput): show input to this level.
+* r(epeat): repeat the execution from here (it will produce the same Exception).
+* t(ransform): display the current Transform.
+* h(elp): print help about the commands.
+* q(uit): quit the debugger.
+</pre></div>
+</div>
+<p>On top of this, it incorporates an in-line co:mpiler so the user can define and inspect variables,
+check attributes, import packages…</p>
+<section id="example">
+<h2>Example<a class="headerlink" href="#example" title="Permalink to this headline"></a></h2>
+<p>Let <code class="docutils literal notranslate"><span class="pre">t</span></code> be the following <a class="reference internal" href="../apidocs/padl.transforms.html#padl.transforms.Pipeline" title="padl.transforms.Pipeline"><code class="xref py py-class docutils literal notranslate"><span class="pre">Pipeline</span></code></a>.</p>
+<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">torch</span>
+<span class="kn">from</span> <span class="nn">padl</span> <span class="kn">import</span> <span class="n">transform</span><span class="p">,</span> <span class="n">batch</span>
+
+<span class="n">to_tensor</span> <span class="o">=</span> <span class="n">transform</span><span class="p">(</span><span class="k">lambda</span> <span class="n">x</span><span class="p">:</span> <span class="n">torch</span><span class="o">.</span><span class="n">LongTensor</span><span class="p">(</span><span class="n">x</span><span class="p">))</span>
+<span class="n">emb</span> <span class="o">=</span> <span class="n">transform</span><span class="p">(</span><span class="n">torch</span><span class="o">.</span><span class="n">nn</span><span class="o">.</span><span class="n">Embedding</span><span class="p">)(</span><span class="mi">10</span><span class="p">,</span> <span class="mi">8</span><span class="p">)</span>
+<span class="n">linear</span> <span class="o">=</span>  <span class="n">transform</span><span class="p">(</span><span class="n">torch</span><span class="o">.</span><span class="n">nn</span><span class="o">.</span><span class="n">Linear</span><span class="p">)(</span><span class="mi">5</span><span class="p">,</span> <span class="mi">5</span><span class="p">)</span>
+<span class="n">t</span> <span class="o">=</span> <span class="n">to_tensor</span> <span class="o">&gt;&gt;</span> <span class="n">batch</span> <span class="o">&gt;&gt;</span> <span class="n">emb</span> <span class="o">&gt;&gt;</span> <span class="n">linear</span>
+</pre></div>
+</div>
+<p>Then, if we run</p>
+<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="nb">list</span><span class="p">(</span><span class="n">t</span><span class="o">.</span><span class="n">train_apply</span><span class="p">([[</span><span class="mi">9</span><span class="p">,</span><span class="mi">8</span><span class="p">,</span><span class="mi">8</span><span class="p">],</span> <span class="p">[</span><span class="mi">4</span><span class="p">,</span> <span class="mi">4</span><span class="p">,</span> <span class="mi">4</span><span class="p">],</span> <span class="p">[</span><span class="mi">5</span><span class="p">,</span> <span class="mi">5</span><span class="p">,</span> <span class="mi">5</span><span class="p">],</span> <span class="p">[</span><span class="mi">6</span><span class="p">,</span> <span class="mi">6</span><span class="p">,</span> <span class="mi">6</span><span class="p">]],</span> <span class="n">batch_size</span><span class="o">=</span><span class="mi">2</span><span class="p">,</span> <span class="n">num_workers</span><span class="o">=</span><span class="mi">0</span><span class="p">))</span>
+</pre></div>
+</div>
+<p>we get an error since the shape of the embeddings does not match with the one expected by the linear
+layer. Calling <code class="xref py py-obj docutils literal notranslate"><span class="pre">pd_debug</span></code> after this will retrieve a console where we can make some checks.</p>
+<p>At the starting level of the debugger, we interact with the entire Transform and its absolute
+input. When going down one level by entering <code class="docutils literal notranslate"><span class="pre">d</span></code> , the debugger switches to the
+{ref} stage <stages> that got the Exception (<em>preprocess</em>,
+<em>forward</em> or <em>postprocess</em>), and each level deeper moves recursively inside the element that failed
+until the <a class="reference internal" href="../apidocs/padl.transforms.html#padl.transforms.AtomicTransform" title="padl.transforms.AtomicTransform"><code class="xref py py-class docutils literal notranslate"><span class="pre">AtomicTransform</span></code></a> that failed is reached.</p>
+<p>Below, some commands and statements are shown:</p>
+<div class="highlight-python notranslate"><div class="highlight"><pre><span></span>&gt; i
+
+[[9, 8, 8], [4, 4, 4]]
+
+&gt; t
+
+Compose - &quot;t&quot;:
+
+      │
+      ▼ x
+   0: lambda x: torch.LongTensor(x)                
+      │
+      ▼ args
+   1: Batchify(dim=0)                              
+      │
+      ▼ input
+   2: Embedding(num_embeddings=10, embedding_dim=8)
+      │
+      ▼ input
+   3: Linear(in_features=5, out_features=5)          &lt;---- error here 
+
+&gt; w
+    
+----&gt; 7    t = to_tensor &gt;&gt; batch &gt;&gt; emb &gt;&gt; linear
+
+&gt; d
+
+Compose:
+
+      │
+      ▼ input
+   0: Embedding(num_embeddings=10, embedding_dim=8)
+      │
+      ▼ input
+   1: Linear(in_features=5, out_features=5)          &lt;---- error here 
+
+&gt; d
+
+Linear(in_features=5, out_features=5) - &quot;linear&quot;:
+
+   Linear(in_features=5, out_features=5, bias=True)  &lt;---- error here 
+
+&gt; w
+
+----&gt; 6    linear = transform(torch.nn.Linear)(5, 5)
+
+&gt; i.shape
+
+torch.Size([2, 3, 8])
+
+&gt; a = 4
+&gt; a + 1
+
+5
+
+&gt; q
+</pre></div>
+</div>
+</section>
+</section>
+
+
+           </div>
+          </div>
+          <footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
+        <a href="pytorch.html" class="btn btn-neutral float-left" title="Using PyTorch Modules with Transforms" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
+        <a href="extras.html" class="btn btn-neutral float-right" title="Extras" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
+    </div>
+
+  <hr/>
+
+  <div role="contentinfo">
+    <p>&#169; Copyright 2021, LF1 GmbH.</p>
+  </div>
+
+  Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
+    <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
+    provided by <a href="https://readthedocs.org">Read the Docs</a>.
+   
+
+</footer>
+        </div>
+      </div>
+    </section>
+  </div>
+  
+
+  <div class="rst-versions" data-toggle="rst-versions" role="note" aria-label="versions">
+    <span class="rst-current-version" data-toggle="rst-current-version">
+      <span class="fa fa-book"> Read the Docs</span>
+      <span id='current-version'></span>
+      <span class="fa fa-caret-down"></span>
+    </span>
+    <div class="rst-other-versions">
+        <dl id='padl-versions' style="display: flex; flex-direction: column;">
+        <dt>Versions</dt>
+          <dd><a href=""></a></dd>
+      </dl>
+      <hr/>
+    </div>
+    <script>
+        console.log('script')
+        var pathname = window.location.pathname.split('padl/')[1].split('/');
+        var currentVersion = pathname[1];
+        var versionsFile = window.location.pathname.split('padl/')[0] + 'padl/docs/versions.json';
+        httpRequest = new XMLHttpRequest();
+        httpRequest.onreadystatechange = addVersions;
+        httpRequest.open('GET', versionsFile);
+        httpRequest.send();
+
+        document.getElementById('current-version')
+          .innerHTML = 'ver: ' + currentVersion;
+        var verList = document.getElementById('padl-versions');
+
+        function addVersions() {
+           console.log(httpRequest)
+          if (httpRequest.readyState === 4) {
+            var versions = JSON.parse(httpRequest.responseText);
+            versions.forEach((ver) => {
+                elem = document.createElement('dd');
+                if (ver == currentVersion) {
+                    elem.innerHTML = '<strong><a style="color: #27ae60;">' + ver + '</a></strong>';
+                }
+                else {
+                    elem.innerHTML = '<a href="/padl/'+ver+'">'+ver+'</a>';
+                }
+                verList.append(elem);
+            })
+          } else {
+          }
+        }
+    </script>
+  </div>
+<script>
+      jQuery(function () {
+          SphinxRtdTheme.Navigation.enable(true);
+      });
+  </script> 
+
+</body>
+</html>
\ No newline at end of file
diff --git a/docs/unstable/usage/extras.html b/docs/unstable/usage/extras.html
index 67f516de..8db525a9 100644
--- a/docs/unstable/usage/extras.html
+++ b/docs/unstable/usage/extras.html
@@ -20,7 +20,7 @@
     <link rel="index" title="Index" href="../genindex.html" />
     <link rel="search" title="Search" href="../search.html" />
     <link rel="next" title="Advanced Topics" href="../advanced.html" />
-    <link rel="prev" title="Using PyTorch Modules with Transforms" href="pytorch.html" /> 
+    <link rel="prev" title="Debugging your Transforms" href="debugging_your_transforms.html" /> 
 </head>
 
 <body class="wy-body-for-nav"> 
@@ -95,6 +95,10 @@
 <li class="toctree-l3"><a class="reference internal" href="pytorch.html#weight-sharing">Weight Sharing</a></li>
 </ul>
 </li>
+<li class="toctree-l2"><a class="reference internal" href="debugging_your_transforms.html">Debugging your Transforms</a><ul>
+<li class="toctree-l3"><a class="reference internal" href="debugging_your_transforms.html#example">Example</a></li>
+</ul>
+</li>
 <li class="toctree-l2 current"><a class="current reference internal" href="#">Extras</a><ul>
 <li class="toctree-l3"><a class="reference internal" href="#the-same-utility">The <code class="xref py py-obj docutils literal notranslate"><span class="pre">same</span></code> Utility</a></li>
 <li class="toctree-l3"><a class="reference internal" href="#applying-transforms-depending-on-the-mode">Applying Transforms Depending on the Mode</a></li>
@@ -232,7 +236,7 @@ <h2>Exception Handling<a class="headerlink" href="#exception-handling" title="Pe
            </div>
           </div>
           <footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
-        <a href="pytorch.html" class="btn btn-neutral float-left" title="Using PyTorch Modules with Transforms" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
+        <a href="debugging_your_transforms.html" class="btn btn-neutral float-left" title="Debugging your Transforms" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
         <a href="../advanced.html" class="btn btn-neutral float-right" title="Advanced Topics" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
     </div>
 
diff --git a/docs/unstable/usage/print_slice.html b/docs/unstable/usage/print_slice.html
index e4313202..cc891a59 100644
--- a/docs/unstable/usage/print_slice.html
+++ b/docs/unstable/usage/print_slice.html
@@ -95,6 +95,10 @@
 <li class="toctree-l3"><a class="reference internal" href="pytorch.html#weight-sharing">Weight Sharing</a></li>
 </ul>
 </li>
+<li class="toctree-l2"><a class="reference internal" href="debugging_your_transforms.html">Debugging your Transforms</a><ul>
+<li class="toctree-l3"><a class="reference internal" href="debugging_your_transforms.html#example">Example</a></li>
+</ul>
+</li>
 <li class="toctree-l2"><a class="reference internal" href="extras.html">Extras</a><ul>
 <li class="toctree-l3"><a class="reference internal" href="extras.html#the-same-utility">The <code class="xref py py-obj docutils literal notranslate"><span class="pre">same</span></code> Utility</a></li>
 <li class="toctree-l3"><a class="reference internal" href="extras.html#applying-transforms-depending-on-the-mode">Applying Transforms Depending on the Mode</a></li>
diff --git a/docs/unstable/usage/pytorch.html b/docs/unstable/usage/pytorch.html
index b12ced07..55ec2454 100644
--- a/docs/unstable/usage/pytorch.html
+++ b/docs/unstable/usage/pytorch.html
@@ -19,7 +19,7 @@
     <script src="../_static/js/theme.js"></script>
     <link rel="index" title="Index" href="../genindex.html" />
     <link rel="search" title="Search" href="../search.html" />
-    <link rel="next" title="Extras" href="extras.html" />
+    <link rel="next" title="Debugging your Transforms" href="debugging_your_transforms.html" />
     <link rel="prev" title="Printing and Slicing" href="print_slice.html" /> 
 </head>
 
@@ -95,6 +95,10 @@
 <li class="toctree-l3"><a class="reference internal" href="#weight-sharing">Weight Sharing</a></li>
 </ul>
 </li>
+<li class="toctree-l2"><a class="reference internal" href="debugging_your_transforms.html">Debugging your Transforms</a><ul>
+<li class="toctree-l3"><a class="reference internal" href="debugging_your_transforms.html#example">Example</a></li>
+</ul>
+</li>
 <li class="toctree-l2"><a class="reference internal" href="extras.html">Extras</a><ul>
 <li class="toctree-l3"><a class="reference internal" href="extras.html#the-same-utility">The <code class="xref py py-obj docutils literal notranslate"><span class="pre">same</span></code> Utility</a></li>
 <li class="toctree-l3"><a class="reference internal" href="extras.html#applying-transforms-depending-on-the-mode">Applying Transforms Depending on the Mode</a></li>
@@ -248,7 +252,7 @@ <h2>Weight Sharing<a class="headerlink" href="#weight-sharing" title="Permalink
           </div>
           <footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
         <a href="print_slice.html" class="btn btn-neutral float-left" title="Printing and Slicing" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
-        <a href="extras.html" class="btn btn-neutral float-right" title="Extras" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
+        <a href="debugging_your_transforms.html" class="btn btn-neutral float-right" title="Debugging your Transforms" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
     </div>
 
   <hr/>
diff --git a/docs/unstable/usage/saving.html b/docs/unstable/usage/saving.html
index 9e4d76c4..b5aafac4 100644
--- a/docs/unstable/usage/saving.html
+++ b/docs/unstable/usage/saving.html
@@ -95,6 +95,10 @@
 <li class="toctree-l3"><a class="reference internal" href="pytorch.html#weight-sharing">Weight Sharing</a></li>
 </ul>
 </li>
+<li class="toctree-l2"><a class="reference internal" href="debugging_your_transforms.html">Debugging your Transforms</a><ul>
+<li class="toctree-l3"><a class="reference internal" href="debugging_your_transforms.html#example">Example</a></li>
+</ul>
+</li>
 <li class="toctree-l2"><a class="reference internal" href="extras.html">Extras</a><ul>
 <li class="toctree-l3"><a class="reference internal" href="extras.html#the-same-utility">The <code class="xref py py-obj docutils literal notranslate"><span class="pre">same</span></code> Utility</a></li>
 <li class="toctree-l3"><a class="reference internal" href="extras.html#applying-transforms-depending-on-the-mode">Applying Transforms Depending on the Mode</a></li>
diff --git a/docs/unstable/usage/stages.html b/docs/unstable/usage/stages.html
index 8ec96025..048b7b93 100644
--- a/docs/unstable/usage/stages.html
+++ b/docs/unstable/usage/stages.html
@@ -95,6 +95,10 @@
 <li class="toctree-l3"><a class="reference internal" href="pytorch.html#weight-sharing">Weight Sharing</a></li>
 </ul>
 </li>
+<li class="toctree-l2"><a class="reference internal" href="debugging_your_transforms.html">Debugging your Transforms</a><ul>
+<li class="toctree-l3"><a class="reference internal" href="debugging_your_transforms.html#example">Example</a></li>
+</ul>
+</li>
 <li class="toctree-l2"><a class="reference internal" href="extras.html">Extras</a><ul>
 <li class="toctree-l3"><a class="reference internal" href="extras.html#the-same-utility">The <code class="xref py py-obj docutils literal notranslate"><span class="pre">same</span></code> Utility</a></li>
 <li class="toctree-l3"><a class="reference internal" href="extras.html#applying-transforms-depending-on-the-mode">Applying Transforms Depending on the Mode</a></li>
diff --git a/docs/unstable/usage/transform.html b/docs/unstable/usage/transform.html
index f8808e9f..2ded5925 100644
--- a/docs/unstable/usage/transform.html
+++ b/docs/unstable/usage/transform.html
@@ -95,6 +95,10 @@
 <li class="toctree-l3"><a class="reference internal" href="pytorch.html#weight-sharing">Weight Sharing</a></li>
 </ul>
 </li>
+<li class="toctree-l2"><a class="reference internal" href="debugging_your_transforms.html">Debugging your Transforms</a><ul>
+<li class="toctree-l3"><a class="reference internal" href="debugging_your_transforms.html#example">Example</a></li>
+</ul>
+</li>
 <li class="toctree-l2"><a class="reference internal" href="extras.html">Extras</a><ul>
 <li class="toctree-l3"><a class="reference internal" href="extras.html#the-same-utility">The <code class="xref py py-obj docutils literal notranslate"><span class="pre">same</span></code> Utility</a></li>
 <li class="toctree-l3"><a class="reference internal" href="extras.html#applying-transforms-depending-on-the-mode">Applying Transforms Depending on the Mode</a></li>
diff --git a/padl/__init__.py b/padl/__init__.py
index ae7ee0c0..a79608dc 100644
--- a/padl/__init__.py
+++ b/padl/__init__.py
@@ -5,6 +5,7 @@
 )
 from padl.dumptools.serialize import value
 from padl.util_transforms import IfTrain, IfEval, IfInfer, IfInMode
+from padl.utils import pd_debug
 from padl.version import __version__
 
 #: this is same
diff --git a/padl/transforms.py b/padl/transforms.py
index c37ad1d9..1b25f534 100644
--- a/padl/transforms.py
+++ b/padl/transforms.py
@@ -12,13 +12,15 @@
 from os import remove
 from shutil import rmtree
 import textwrap
+import traceback
 from tempfile import TemporaryDirectory
 import types
+from dataclasses import dataclass
 try:
     from typing import Literal
 except ImportError:
     from typing_extensions import Literal
-from typing import Callable, Iterable, Iterator, List, Optional, Set, Tuple, Union
+from typing import Callable, Iterable, Iterator, List, Optional, Set, Tuple, Union, Any
 from warnings import warn
 from zipfile import ZipFile
 
@@ -37,6 +39,9 @@
     make_green, create_arrow, format_argument, visible_len
 
 
+_pd_trace = []
+
+
 def _unpack_batch(args):
     """Convert an input in batch-form into a tuple of datapoints.
 
@@ -133,7 +138,7 @@ class Transform:
 
     :param call_info: A `CallInfo` object containing information about the how the transform was
         created (needed for saving).
-    :param pd_name: name of the transform
+    :param pd_name: name of the transform.
     """
     pd_mode = None
     _pd_external_full_dump_modules = set()
@@ -146,6 +151,7 @@ def __init__(self, call_info: Optional[inspector.CallInfo] = None,
         self._pd_varname = {}
         self._pd_name = pd_name
         self._pd_device = 'cpu'
+        self._pd_traceback = traceback.extract_stack()
         self._pd_external_full_dump = False
 
     @property
@@ -508,6 +514,32 @@ def f(x):
 
         return graph
 
+    def _pd_process_traceback(self):
+        """Find where the Transform was defined (file, lineno, file) given the traceback. """
+        a_tb = None
+        for a_tb in self._pd_traceback[::-1]:
+            if 'padl' in a_tb[0]:
+                continue
+            break
+        return f'{a_tb.filename} in {a_tb.name}\n----> {make_green(a_tb.lineno)}    {a_tb.line}'
+
+    def _pd_get_error_idx(self):
+        """Get what element of a :class:`padl.transforms.Transform` is failing if an Exception is
+        produced during an execution.
+
+        Subclasses of :class:`padl.transforms.Transform` need to implement this method.
+        """
+        return NotImplemented
+
+    def _pd_trace_error(self, position: int, arg):
+        """Add some error description to :obj:`pd_trace`. """
+        try:
+            str_ = self._pd_fullrepr(marker=(position, '\033[31m  <---- error here \033[0m'))
+            _pd_trace.append(_TraceItem(str_, self._pd_process_traceback(), arg,
+                                        self, Transform.pd_mode, position))
+        except Exception:
+            warn('Error tracing failed')
+
     def _pd_evaluable_repr(self, indent: int = 0) -> str:
         """Return a string that if evaluated *in the same scope where the transform was created*
         creates the transform. """
@@ -562,19 +594,22 @@ def _pd_dumps(self, return_versions: bool = False,
     def __repr__(self):
         return self._pd_shortrepr(formatting=False)
 
-    def _repr_pretty_(self, p, cycle) -> str:
-        # pylint: disable=invalid-name
+    def _repr_pretty_(self, p, cycle):
+        #pylint: disable=invalid-name
+        p.text(self._pd_fullrepr() if not cycle else '...')
+
+    def _pd_fullrepr(self, marker=None):
         title = self._pd_title()
         if self.pd_name is not None and self.pd_name != title:
             title = make_bold(title) + f' - "{self.pd_name}"'
         else:
             title = make_bold(title)
         top_message = title + ':' + '\n\n'
-        bottom_message = textwrap.indent(self._pd_longrepr(), '   ')
-        p.text(top_message + bottom_message if not cycle else '...')
+        bottom_message = textwrap.indent(self._pd_longrepr(marker=marker), '   ')
+        return top_message + bottom_message
 
-    def _pd_longrepr(self, formatting=True) -> str:
-        """A lone string representation of the transform."""
+    def _pd_longrepr(self, formatting=True, marker=None) -> str:
+        """A line string representation of the transform."""
         raise NotImplementedError
 
     def _pd_parensrepr(self, formatting=True) -> str:
@@ -673,9 +708,13 @@ def _pd_unpack_argument(self, arg) -> bool:
         return False
 
     def _pd_unpack_args_and_call(self, arg):
-        if self._pd_unpack_argument(arg):
-            return self(*arg)
-        return self(arg)
+        try:
+            if self._pd_unpack_argument(arg):
+                return self(*arg)
+            return self(arg)
+        except Exception as err:
+            self._pd_trace_error(0, arg)
+            raise err
 
     def pd_call_in_mode(self, arg, mode: Mode, ignore_grad=False):
         """Call the transform, with possibility to pass multiple arguments.
@@ -742,6 +781,10 @@ def _pd_itercall(self, args, mode: Mode, loader_kwargs: Optional[dict] = None,
         """
         assert mode in ('eval', 'train'), '_pd_itercall can only be used with mode eval or train'
 
+        _pd_trace.clear()
+
+        self.pd_forward_device_check()
+
         preprocess = self.pd_preprocess
         forward = self.pd_forward
         post = self.pd_postprocess
@@ -756,20 +799,32 @@ def _pd_itercall(self, args, mode: Mode, loader_kwargs: Optional[dict] = None,
         if use_preprocess:
             loader = self.pd_get_loader(args, preprocess, mode, **loader_kwargs)
         else:
-            loader = args
+            loader = _SimpleGetter(args)
 
         def _gen():
-            for batch in loader:
+            for ix, batch in loader:
                 batch = _move_to_device(batch, self.pd_device)
-
                 output = batch
+
                 if use_forward:
-                    output = forward.pd_call_in_mode(batch, mode)
+                    try:
+                        output = forward.pd_call_in_mode(batch, mode)
+                    except Exception as err:
+                        self._pd_trace_error(self._pd_get_error_idx('forward'),
+                                             [args[i] for i in ix])
+                        raise err
 
                 if use_post or flatten:
                     output = _unpack_batch(output)
                     if use_post:
-                        output = [post.pd_call_in_mode(x, mode, ignore_grad=True) for x in output]
+                        try:
+                            output = [post.pd_call_in_mode(x, mode, ignore_grad=True) \
+                                      for x in output]
+                        except Exception as err:
+                            self._pd_trace_error(self._pd_get_error_idx('postprocess'),
+                                                 [args[i] for i in ix])
+                            raise err
+
                     for out in output:
                         yield self._pd_format_output(out)
                 else:
@@ -839,8 +894,7 @@ def pd_parameters(self) -> Iterator:
         for layer in self.pd_layers:
             yield from layer.parameters()
 
-    @staticmethod
-    def pd_get_loader(args, preprocess, mode, **kwargs) -> DataLoader:
+    def pd_get_loader(self, args, preprocess, mode, **kwargs) -> DataLoader:
         """Get a pytorch data loader.
 
         :param args: A sequence of datapoints.
@@ -852,6 +906,7 @@ def pd_get_loader(args, preprocess, mode, **kwargs) -> DataLoader:
         sequence = _ItemGetter(
             args,
             lambda *args: preprocess.pd_call_in_mode(*args, mode, ignore_grad=True),
+            self
         )
 
         return DataLoader(
@@ -867,6 +922,9 @@ def infer_apply(self, inputs):
 
         :param inputs: The input.
         """
+        in_args = inputs
+        _pd_trace.clear()
+
         preprocess = self.pd_preprocess
         forward = self.pd_forward
         postprocess = self.pd_postprocess
@@ -884,9 +942,17 @@ def infer_apply(self, inputs):
         if pd_device != 'cpu':
             inputs = _move_to_device(inputs, pd_device)
         if use_forward:
-            inputs = forward.pd_call_in_mode(inputs, mode='infer')
+            try:
+                inputs = forward.pd_call_in_mode(inputs, mode='infer')
+            except Exception as err:
+                self._pd_trace_error(self._pd_get_error_idx('forward'), in_args)
+                raise err
         if use_post:
-            inputs = postprocess.pd_call_in_mode(inputs, mode='infer', ignore_grad=True)
+            try:
+                inputs = postprocess.pd_call_in_mode(inputs, mode='infer', ignore_grad=True)
+            except Exception as err:
+                self._pd_trace_error(self._pd_get_error_idx('postprocess'), in_args)
+                raise err
         return self._pd_format_output(inputs)
 
     def eval_apply(self, inputs: Iterable, flatten: bool = False, **kwargs):
@@ -953,6 +1019,36 @@ def _pd_direct_subtransforms(self) -> Iterator[Transform]:
             if isinstance(v, Transform):
                 yield v
 
+    def _pd_get_non_target_stage_idx(self):
+        """Return an integer to track where a :class:`Compose` which failed got the Exception.
+
+        Example:
+            t = forward_1 >> unbatch >> post
+
+            Let's suppose we get an error on `post`, `post` is the index 1 of
+            `t.pd_postprocess`, then the element that fails on `t` is
+            t.pd_forward._pd_get_non_target_stage_idx() + 1 = 1 + 1 = 2
+        """
+        return 1
+
+    def _pd_get_target_stage_idx(self, is_entire_transform=None):
+        """Return an integer to track where a :class:`Compose` which failed got the Exception.
+
+        Example:
+            t = prep >> batch >> forward_1
+            Let's suppose we get an error on `forward_1`. `forward_1` is the index 0 of
+            `t.pd_forward`, then the element that fails on `t` is
+            2 + t.pd_forward._pd_get_stage_idx() = 2 + 0 = 2
+
+        :param is_entire_transform: *False* if *self* is not a part of a larger :class:`Transform`,
+            else *True*
+        """
+        return 0
+
+    def _pd_get_error_idx(self, stage: str):
+        assert stage in ('forward', 'postprocess')
+        return 0
+
 
 class FunctionTransform(AtomicTransform):
     """A transform that wraps a *function*.
@@ -1021,11 +1117,14 @@ def _pd_signature(self) -> List[str]:
             return inspect.signature(self).parameters
         return [f'arg_{i}' for i in range(self._pd_number_of_inputs)]
 
-    def _pd_longrepr(self, formatting=True) -> str:
+    def _pd_longrepr(self, formatting=True, marker=None) -> str:
         try:
-            return '\n'.join(self.source.split('\n')[:30])
+            str_ = self.source.split('\n')[:30]
+            if marker:
+                return str_[0] + marker[1] + '\n'.join(str_[1:])
+            return '\n'.join(str_)
         except TypeError:
-            return self._pd_call
+            return self._pd_call + marker[1] + '\n' if marker else self._pd_call
 
     def _pd_shortrepr(self, formatting=True) -> str:
         if len(self._pd_longrepr().split('\n', 1)) == 1:
@@ -1199,11 +1298,14 @@ def _formatted_args(self) -> str:
                 args_list.append(f'{key}={format_argument(value)}')
         return ', '.join(args_list)
 
-    def _pd_longrepr(self) -> str:
+    def _pd_longrepr(self, marker=None) -> str:
         try:
-            return '\n'.join(self.source.split('\n')[:30])
+            str_ = self.source.split('\n')[:30]
+            if marker:
+                return str_[0] + marker[1] + '\n' + '\n'.join(str_[1:])
+            return '\n'.join(str_)
         except symfinder.NameNotFound:
-            return self._pd_call
+            return self._pd_call + marker[1] if marker else self._pd_call
 
     def _pd_title(self) -> str:
         title = type(self).__name__
@@ -1240,8 +1342,11 @@ def post_load(self, path, i):
         print('loading torch module from', checkpoint_path)
         self.load_state_dict(torch.load(checkpoint_path))
 
-    def _pd_longrepr(self) -> str:
-        return torch.nn.Module.__repr__(self)
+    def _pd_longrepr(self, marker=None) -> str:
+        out = torch.nn.Module.__repr__(self)
+        if marker:
+            return out + marker[1]
+        return out
 
 
 class Map(Transform):
@@ -1320,8 +1425,9 @@ def __call__(self, args: Iterable):
         """
         return tuple([self.transform._pd_unpack_args_and_call(arg) for arg in args])
 
-    def _pd_longrepr(self, formatting=True) -> str:
-        return '~ ' + self.transform._pd_shortrepr(formatting)
+    def _pd_longrepr(self, formatting=True, marker=None) -> str:
+        str_ = '~ ' + self.transform._pd_shortrepr(formatting)
+        return str_ + marker[1] if marker else str_
 
     @property
     def _pd_direct_subtransforms(self) -> Iterator[Transform]:
@@ -1398,6 +1504,11 @@ def __getitem__(self, item: Union[int, slice, str]) -> Transform:
     def __len__(self):
         return len(self.transforms)
 
+    def _pd_unpack_args_and_call(self, arg):
+        if self._pd_unpack_argument(arg):
+            return self(*arg)
+        return self(arg)
+
     def _pd_evaluable_repr_inner(self, indent=0):
         sub_reprs = [
             x.pd_varname(self._pd_call_info.scope) or x._pd_evaluable_repr(indent + 4)
@@ -1460,7 +1571,7 @@ def _pd_build_codegraph(self, graph=None, name=None):
             transform._pd_build_codegraph(graph, varname)
         return graph
 
-    def _pd_longrepr(self, formatting=True):
+    def _pd_longrepr(self, formatting=True, marker=None):
         between = f'\n{make_green(self.display_op, not formatting)}  \n'
         rows = [make_bold(f'{i}: ', not formatting) + t._pd_shortrepr(formatting)
                 for i, t in enumerate(self.transforms)]
@@ -1581,8 +1692,48 @@ def _pd_get_keys(transforms):
             deduped_keys.append(new_name)
         return deduped_keys
 
+    def _pd_get_non_target_stage_idx(self):
+        """Return an integer to track where a :class:`Compose` which failed got the Exception.
+
+        Example:
+            t = ((prep_1 >> batch) + (prep_2 >> batch)) >> forward_1
+            Let's suppose we get an error on `forward_1`. `forward_1` is the index 0 of
+            `t.pd_forward`, then the element that fails on `t` is
+            t.pd_preprocess._pd_get_non_target_stage_idx() + 0 = 1 + 0 = 1
+        """
+        return 1
+
+    def _pd_get_target_stage_idx(self, is_entire_transform=None):
+        """Return an integer to track where a :class:`Compose` which failed got the Exception.
+
+        Example:
+            t = prep >> batch >> (forward_1 + forward_2)
+            Let's suppose we get an error on `(forward_1 + forward_2)`. `(forward_1 + forward_2)`
+            is the index 0 of `t.pd_forward`, then the element that fails on `t` is
+            2 + t.pd_forward._pd_get_stage_idx() = 2 + 0 = 2
+
+        :param is_entire_transform: *False* if *self* is a part of a larger :class:`Transform`,
+            else *True*
+        """
+
+        return 0
+
+    def _pd_get_error_idx(self, stage: str):
+        """Track the index where a :class:`Pipeline` fails from the one that got the Exception on
+        :meth:`self.pd_preprocess`, :meth:`self.pd_forward` or :meth:`self.pd_postprocess`.
+
+        Example:
+            t = (t_11 >> batch >> t_12) + (t_21 >> batch >> t_22)
+            then,
+            t.pd_forward = t_12 / t_22.
+            If we know that :meth:`t.pd_forward` is failing on `t_22`, which is its element 1,
+            the index of the :class:`Transform` that fails on `t` is the same.
+        """
+        assert stage in ('forward', 'postprocess')
+        return _pd_trace[-1].error_position
+
     def _add_name_to_splits(self, final_splits):
-        """Ad name to split-transforms. """
+        """Add name to split-transforms. """
         if self._pd_name is not None:
             for i, s in enumerate(final_splits):
                 if not isinstance(s, Identity):
@@ -1592,12 +1743,12 @@ def _add_name_to_splits(self, final_splits):
 class Compose(Pipeline):
     """Apply series of transforms on input.
 
-    Compose([t1, t2, t3])(x) = t3(t1(t2(x)))
+    Compose([t1, t2, t3])(x) = t3(t2(t1(x)))
 
     :param transforms: List of transforms to compose.
     :param call_info: A `CallInfo` object containing information about the how the transform was
         created (needed for saving).
-    :param pd_name: name of the Compose transform
+    :param pd_name: name of the Compose transform.
     :param pd_group: If *True*, do not flatten this when used as child transform in a
         `Pipeline`.
     :return: output from series of transforms
@@ -1655,12 +1806,14 @@ def _pd_splits(self, input_components=0, has_batchify=False) -> Tuple[Union[int,
             if len(split) > 1:  # combine sub_splits
                 final_splits.append(Compose(split))
             elif len(split) == 1:  # if it's just one, no need to combine
-                final_splits.append(split[0])
+                if isinstance(split[0], Compose):
+                    final_splits.append(group(split[0]))
+                else:
+                    final_splits.append(split[0])
             else:  # if it's empty: identity
                 final_splits.append(identity)
 
         self._add_name_to_splits(final_splits)
-
         return output_components, final_splits, has_batchify
 
     @staticmethod
@@ -1679,7 +1832,7 @@ def _pd_classify_nodetype(i, t, t_m1, cw, cw_m1):
 
         return type_
 
-    def _pd_longrepr(self, formatting=True) -> str:  # TODO: make it respect the formatting
+    def _pd_longrepr(self, formatting=True, marker=None) -> str:  # TODO: make it respect the formatting
         """Create a detailed formatted representation of the transform. For multi-line inputs
         the lines are connected with arrows indicating data flow.
         """
@@ -1689,7 +1842,6 @@ def _pd_longrepr(self, formatting=True) -> str:  # TODO: make it respect the for
             else [t._pd_shortrepr()]
             for t in self.transforms
         ]
-
         children_widths = [[visible_len(x) for x in row] for row in rows]
         # get maximum widths in "columns"
         children_widths_matrix = np.zeros((len(self.transforms),
@@ -1772,7 +1924,8 @@ def _pd_longrepr(self, formatting=True) -> str:  # TODO: make it respect the for
             mark = combine_multi_line_strings(subarrows + [to_format])
             mark = '\n'.join(['   ' + x for x in mark.split('\n')])
             output.append(make_green(mark))
-            output.append(make_bold(f'{i}: ') + r)
+            output.append(make_bold(f'{i}: ') + r + (marker[1] if marker and
+                                                                  marker[0] == i else ''))
         return '\n'.join(output)
 
     def __call__(self, args):
@@ -1781,10 +1934,77 @@ def __call__(self, args):
         :param args: Arguments to call with.
         :return: Output from series of transforms.
         """
-        for transform_ in self.transforms:
-            args = transform_._pd_unpack_args_and_call(args)
+        _in_args = args
+        for i, transform_ in enumerate(self.transforms):
+            try:
+                args = transform_._pd_unpack_args_and_call(args)
+            except Exception as err:
+                self._pd_trace_error(i, _in_args)
+                raise err
         return args
 
+    def _pd_get_non_target_stage_idx(self):
+        """Return an integer to track where a :class:`Compose` which failed got the Exception.
+
+        Example:
+            t = prep >> batch >> forward_1
+
+            Let's suppose we get an error on `forward_1`, `forward_1` is the index 0 of
+            `t.pd_forward`, then the element that fails on `t` is
+            `t.pd_preprocess._pd_get_non_target_stage_idx() + 0 = len(t.pd_preprocess) + 0 =
+                2 + 0 = 2
+        """
+        return 1 if self._pd_group else len(self)
+
+    def _pd_get_target_stage_idx(self, is_entire_transform: bool):
+        """Return an integer to track where a :class:`Compose` which failed got the Exception.
+
+        Example:
+             t = prep >> batch >> forward_1 >> forward_2
+
+            Let's suppose we get an error on `forward_2`. `t.pd_forward` is
+            `t.pd_forward` = forward_1 >> forward_2`. `forward_2` is the index 1 of `t.pd_forward`,
+            then the element that fails on `t` is
+            2 + t.pd_forward._pd_get_stage_idx() = 2 + 1 = 3
+
+        :param is_entire_transform: *False* if *self* is a part of a larger :class:`Transform`,
+            else *True*
+        """
+        return 0 if self._pd_group and not is_entire_transform else _pd_trace[-1].error_position
+
+    def _pd_get_error_idx(self, stage: str):
+        """Track the index where a :class:`Compose` fails from the index that got the Exception
+        on :meth:`self.pd_preprocess`, :meth:`self.pd_forward` or :meth:`self.pd_postprocess`.
+
+        Examples:
+            t = t_1 >> t_2 >> batch >> t_3 >> t_4
+            then,
+            t.pd_forward = t_3 >> t_4.
+            If we know that :meth:`t.pd_forward` is failing on `t_4`, which is its element 1, then
+            `t` is failing on len(t.pd_preprocess) + 1.
+
+            t = t_1 >> t_2 >> batch >> ((t_3 >> t_4) + (t_5 >> t_6))
+            then,
+            t.pd_forward = (t_3 >> t_4) + (t_5 >> t_6).
+            No matter what branch is failing on :meth:`t.pd_forward`, the error on `t` is on
+            len(t.pd_preprocess) + 0 = 3.
+        """
+        assert stage in ('forward', 'postprocess')
+        preprocess = self.pd_preprocess
+        forward = self.pd_forward
+        postprocess = self.pd_postprocess
+        preprocess_idx = preprocess._pd_get_non_target_stage_idx()
+
+        if stage == 'forward':
+            is_entire_transform = isinstance(preprocess, Identity) and \
+                                  isinstance(postprocess, Identity)
+            return preprocess_idx + forward._pd_get_target_stage_idx(is_entire_transform)
+
+        is_entire_transform = isinstance(preprocess, Identity) and \
+                              isinstance(forward, Identity)
+        return preprocess_idx + forward._pd_get_non_target_stage_idx() + \
+               postprocess._pd_get_target_stage_idx(is_entire_transform)
+
 
 class Rollout(Pipeline):
     """Apply a list of transform to same input and get tuple output
@@ -1884,7 +2104,6 @@ def _pd_splits(self, input_components=0) -> Tuple[Union[int, List],
         final_splits = res
 
         self._add_name_to_splits(final_splits)
-
         return output_components, final_splits, has_batchify
 
     def __call__(self, args):
@@ -1894,20 +2113,27 @@ def __call__(self, args):
         :return: namedtuple of outputs
         """
         out = []
-        for transform_ in self.transforms:
-            out.append(transform_._pd_unpack_args_and_call(args))
+        for i, transform_ in enumerate(self.transforms):
+            try:
+                out.append(transform_._pd_unpack_args_and_call(args))
+            except Exception as err:
+                self._pd_trace_error(i, args)
+                raise err
+
         if Transform.pd_mode is not None:
             return tuple(out)
         return self._pd_output_formatter(out)
 
-    def _pd_longrepr(self, formatting=True) -> str:
+    def _pd_longrepr(self, formatting=True, marker=None) -> str:
         make_green_ = lambda x: make_green(x, not formatting)
         make_bold_ = lambda x: make_bold(x, not formatting)
         between = f'\n{make_green_("│ " + self.display_op)}  \n'
         rows = [make_green_('├─▶ ') + make_bold_(f'{i}: ') + t._pd_shortrepr()
+                + (marker[1] if marker and marker[0] == i else '')
                 for i, t in enumerate(self.transforms[:-1])]
         rows.append(make_green_('└─▶ ') + make_bold_(f'{len(self.transforms) - 1}: ')
-                    + self.transforms[-1]._pd_shortrepr())
+                    + self.transforms[-1]._pd_shortrepr() +
+                    (marker[1] if marker and marker[0] == len(self.transforms) - 1 else ''))
         return between.join(rows) + '\n'
 
 
@@ -1979,7 +2205,6 @@ def _pd_splits(self, input_components=0) -> Tuple[Union[int, List],
         final_splits = res
 
         self._add_name_to_splits(final_splits)
-
         return output_components, final_splits, has_batchify
 
     def __call__(self, args):
@@ -1990,12 +2215,17 @@ def __call__(self, args):
         """
         out = []
         for ind, transform_ in enumerate(self.transforms):
-            out.append(transform_._pd_unpack_args_and_call(args[ind]))
+            try:
+                out.append(transform_._pd_unpack_args_and_call(args[ind]))
+            except Exception as err:
+                self._pd_trace_error(ind, args)
+                raise err
+
         if Transform.pd_mode is not None:
             return tuple(out)
         return self._pd_output_formatter(out)
 
-    def _pd_longrepr(self, formatting=True) -> str:
+    def _pd_longrepr(self, formatting=True, marker=None) -> str:
         if not formatting:
             make_green_ = lambda x: x
             make_bold_ = lambda x: x
@@ -2016,16 +2246,24 @@ def horizontal(n):
         for i, t in enumerate(self.transforms):
             out += (
                 make_green_(pipes(len_ - i - 1) + '└' + horizontal(i + 1) + '▶ ') +
-                make_bold_(f'{i}: ') + t._pd_shortrepr() + '\n'
+                make_bold_(f'{i}: ') + t._pd_shortrepr()
             )
+            out += marker[1] + '\n' if marker and marker[0] == i else '\n'
             if i < len(self.transforms) - 1:
                 out += f'{make_green_(pipes(len_ - i - 1) + spaces(i + 2) + self.display_op)}  \n'
+
         return out
 
 
 class BuiltinTransform(ClassTransform):
     """A builtin transform will simply always be imported, never fully dumped. """
 
+    def _pd_longrepr(self, formatting=True, marker=None):
+        out = self._pd_call.split('padl.')[-1]
+        if marker:
+            out += marker[1]
+        return out
+
     @property
     def _pd_full_dump(self):
         return False
@@ -2040,6 +2278,9 @@ def __init__(self):
     def __call__(self, args):
         return args
 
+    def _pd_get_non_target_stage_idx(self):
+        return 0
+
 
 identity = Identity()
 
@@ -2211,18 +2452,64 @@ class _ItemGetter:
 
     :param samples: An object implementing __getitem__ and __len__.
     :param transform: Preprocessing transform.
+    :param entire_transform: :class:`Transform` which *transform* belongs to, i.e.,
+        :class:`Transform` whose preprocessing part is *transform*.
     """
 
-    def __init__(self, samples, transform):
+    def __init__(self, samples, transform, entire_transform):
         self.samples = samples
         self.transform = transform
+        self.entire_transform = entire_transform
+
+    def __getitem__(self, item):
+        try:
+            return item, self.transform(self.samples[item])
+        except Exception as err:
+            is_entire_transform = isinstance(self.entire_transform.pd_forward, Identity) and \
+                                  isinstance(self.entire_transform.pd_postprocess, Identity)
+            self.entire_transform._pd_trace_error(
+                self.entire_transform.pd_preprocess._pd_get_target_stage_idx(is_entire_transform),
+                [self.samples[item]]
+            )
+            raise err
+
+    def __len__(self):
+        return len(self.samples)
+
+
+class _SimpleGetter:
+    """A simple item getter.
+
+    :param samples: An object implementing __getitem__ and __len__.
+    """
+
+    def __init__(self, samples):
+        self.samples = samples
 
     def __getitem__(self, item):
-        return self.transform(self.samples[item])
+        return [item], self.samples[item]
 
     def __len__(self):
         return len(self.samples)
 
+@dataclass
+class _TraceItem:
+    """Catch information of an Exception produced in a Transform call.
+
+    :param transform_str: string representation of a *Transform* that has produced an Exception.
+    :param code_position: line where the Transform that has produced the Exception was defined.
+    :param args: arguments input to the Transform.
+    :param transform: Transform that produced the Exception.
+    :param pd_mode: mode (*train*, *eval* or *infer*) of *transform*
+    :param error_position: item inside *transform* that has produced the Exception.
+    """
+    transform_str: str
+    code_position: str
+    args: Any
+    transform: Transform
+    pd_mode: str
+    error_position: int
+
 
 def fulldump(transform_or_module):
     """Switch a Transform or module or package to the "fulldump" mode.
diff --git a/padl/utils.py b/padl/utils.py
index 8856e56a..527df052 100644
--- a/padl/utils.py
+++ b/padl/utils.py
@@ -3,6 +3,7 @@
 from padl.dumptools import inspector
 from padl.print_utils import format_argument
 from padl.transforms import AtomicTransform
+from padl.transforms import _pd_trace
 
 
 def _maketrans(attr, getitem=False):
@@ -37,8 +38,9 @@ def _formatted_args(self) -> str:
             args_list += [f'{key}={format_argument(val)}' for key, val in self._kwargs.items()]
             return ', '.join(args_list)
 
-        def _pd_longrepr(self, formatting=True):
-            return self._pd_shortrepr()
+        def _pd_longrepr(self, formatting=True, marker=None):
+            out = self._pd_shortrepr()
+            return out + marker[1] if marker else out
 
         def _pd_shortrepr(self, formatting=True):
             return f'{attr}({self._formatted_args()})'
@@ -61,3 +63,129 @@ def __getattr__(self, attr):
 
 #: Transform factory for capturing attributes/ get-items.
 same = _Same()
+
+
+class _Debug:
+    """Customized debugger for :class:`padl.transforms.Transform`s.
+
+    When an exception on the execution of a :class:`padl.transforms.Transform` is produced and a
+    :class:`_Debug` object is called, an interactive debugger at different levels in the
+    :class:`padl.transforms.Transform` is gotten.
+
+    At the top, the user interacts with the entire transform and its absolute input. One level
+    down, it goes directly to the stage that got the Exception (either to
+    :meth:`padl.transforms.Transform.pd_preprocess`, :meth:`padl.transforms.Transform.pd_forward`,
+    or :meth:`padl.transforms.Transform.pd_postprocess`) and each level deeper moves recursively
+    inside the element that failed until the :class:`padl.transforms.AtomicTransform` that got the
+    Exception is reached.
+    """
+    def __init__(self):
+        self.trans = None
+        self.args = None
+        self.default_msg = (
+            'Defined commands are: \n'
+            '   u(p): step up\n'
+            '   d(own): step down\n'
+            '   w(here am I?): show code position\n'
+            '   i(nput): show input here\n'
+            '   r(epeat): repeat here (will produce the same exception)\n'
+            '   t(ransform): displays the current transform\n'
+            '   h(elp): print help about the commands\n'
+            '   q(uit): quit'
+        )
+
+    def __call__(self) -> None:
+        """Call me for getting an interactive debugger in case of error.
+
+        User can give following input and expect response
+            u(p): step up
+            d(own): step down
+            w(here am I?): show code position
+            i(nput): show input here
+            r(epeat): repeat here (will produce the same exception)
+            h(elp): print help about the commands
+            q(uit): quit'
+        """
+        pos = len(_pd_trace) - 1
+        print(self.default_msg + '\n' + _pd_trace[pos].transform_str)
+
+        while True:
+            try:
+                x = input('> ')
+            except IndexError:
+                continue
+            if x == 'd':
+                pos, msg = self._down_step(pos, _pd_trace)
+            elif x == 'u':
+                pos, msg = self._up_step(pos, _pd_trace)
+            elif x == 'q':
+                self.args = _pd_trace[pos].args
+                self.trans = _pd_trace[pos].transform
+                break
+            elif x == 'w':
+                msg = _pd_trace[pos].code_position
+            elif x == 'i':
+                msg = _pd_trace[pos].args
+            elif x == 'r':
+                self.args = _pd_trace[pos].args
+                self.trans = _pd_trace[pos].transform
+                # This 0 is because the last element carries a problem: when adding the last
+                # element to _pd_trace *Transform.pd_mode* has been already set up to None again.
+                self.repeat(_pd_trace[0].pd_mode, pos)
+            elif x == 'h' or x == 'help':
+                msg = self.default_msg
+            elif x == 't':
+                msg = _pd_trace[pos].transform_str
+            else:
+                i = _pd_trace[pos].args
+                try:
+                    code = compile(x, '', 'single')
+                    exec(code)
+                except Exception as err:
+                    print(err)
+
+            if x in {'d', 'u', 'w', 'i', 'h', 'help', 't'}:
+                print(f'\n{msg}\n')
+
+    def repeat(self, mode: str, pos: int) -> None:
+        """Repeat the execution from the current position *pos* (the same Exception will be
+        produced).
+
+        :param mode: mode ('train', 'eval', 'infer').
+        :param pos: level of the :class:`Transform` we are inspecting.
+        """
+        assert mode in ('train', 'eval', 'infer'), 'Mode should be "train", "eval" or "infer'
+        _pd_trace.clear()
+        if pos == len(_pd_trace) - 1:
+            self._repeat_entire(mode)
+        else:
+            self._repeat_on_stage(mode)
+
+    @staticmethod
+    def _down_step(pos, pd_trace):
+        if pos > 0:
+            pos -= 1
+            return pos, pd_trace[pos].transform_str
+        return pos, 'Reached the bottom.'
+
+    @staticmethod
+    def _up_step(pos, pd_trace):
+        if pos < len(pd_trace) - 1:
+            pos += 1
+            return pos, pd_trace[pos].transform_str
+        return pos, 'Reached top level.'
+
+    def _repeat_entire(self, mode):
+        if mode == 'train':
+            list(self.trans.train_apply(self.args, batch_size=len(self.args), num_workers=0))
+        elif mode == 'eval':
+            list(self.trans.eval_apply(self.args, batch_size=len(self.args), num_workers=0))
+        elif mode == 'infer':
+            self.trans.infer_apply(self.args)
+        raise ValueError('Mode is not set, it should be "train", "eval" or "infer')
+
+    def _repeat_on_stage(self, mode):
+        self.trans.pd_call_in_mode(self.args, mode)
+
+
+pd_debug = _Debug()


Test patch:
diff --git a/tests/unittests/test_transforms.py b/tests/unittests/test_transforms.py
index f4523e46..2328b9b3 100644
--- a/tests/unittests/test_transforms.py
+++ b/tests/unittests/test_transforms.py
@@ -959,3 +959,26 @@ def test_double_4(self):
     def test_no_double(self):
         t = plus_one >> plus_one / batch >> batch / plus_one >> plus_one
         t.pd_forward
+
+
+class TestTrace:
+    @pytest.fixture(autouse=True, scope='class')
+    def init(self, request):
+        emb = transform(torch.nn.Embedding)(10, 8)
+        linear = transform(torch.nn.Linear)(4, 4)
+        to_tensor = transform(lambda x: torch.LongTensor(x))
+        request.cls.pipeline = to_tensor >> batch >> emb >> linear
+
+    def test_pd_trace(self):
+        try:
+            list(self.pipeline.train_apply([[9, 8, 8], [4, 4, 4], [5, 5, 5], [6, 6, 6]],
+                                           batch_size=2, num_workers=0))
+        except:
+            from padl.transforms import _pd_trace
+            assert len(_pd_trace) == 3
+            assert _pd_trace[0].error_position == 0
+            assert torch.equal(_pd_trace[1].args, torch.LongTensor([[9, 8, 8], [4, 4, 4]]))
+            assert _pd_trace[1].error_position == 1
+            assert _pd_trace[1].pd_mode == 'train'
+            assert _pd_trace[2].args == [[9, 8, 8], [4, 4, 4]]
+            assert _pd_trace[2].error_position == 3
diff --git a/tests/unittests/test_util_transforms.py b/tests/unittests/test_util_transforms.py
index cce595d4..9751ea70 100644
--- a/tests/unittests/test_util_transforms.py
+++ b/tests/unittests/test_util_transforms.py
@@ -1,7 +1,6 @@
 import pytest
 import torch
-
-from padl import transform, Batchify, Unbatchify, batch, Identity
+from padl import transform, Batchify, batch, Identity
 import padl.transforms as padl
 from padl.util_transforms import IfTrain, IfEval, IfInfer, Try