You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In this exercise you will use setuptools to compile a pytorch extension with PyTorch's `cpp_extension`
4
+
module.
4
5
5
-
## Description
6
6
7
-
This repository implements a `symmetric` padding extension for PyTorch. Symmetric padding, for example, is the default in `pywt` (https://pywavelets.readthedocs.io). Providing this functionality as a C++ module in PyTorch will allow us to speed up Wavelet computations in PyTorch.
7
+
The task is to implement `symmetric` padding extension for PyTorch. Symmetric padding, for example, is the default in `pywt` (https://pywavelets.readthedocs.io). PyTorch lacks this functionality. In this exercise, we will provide it.
8
8
9
-
## Testing and Verification
9
+
###Testing and Verification
10
10
11
11
Follow these steps:
12
12
@@ -15,3 +15,32 @@ Follow these steps:
15
15
3. Run the tests with `nox -s test`.
16
16
17
17
18
+
### Implementing your module in c++.
19
+
20
+
Symmetric padding extends a signal by mirroring samples. This mode is also known as half-sample symmetric [[pywt-docs](https://pywavelets.readthedocs.io/en/latest/ref/signal-extension-modes.html)].
21
+
The idea is to repeat samples in reverse order at the boundary.
22
+
23
+
```
24
+
... x2 x1 | x1 x2 ... xn | xn xn-1 ...
25
+
```
26
+
27
+
Implement this boundary extension mode in the `src/sympad.cpp` file's `_pad_symmetric_1d`-function by resolving the `TODO`'s in the code.
28
+
29
+
30
+
### Using your Pytorch module
31
+
32
+
1. create a virtual environment `python -m venv virtual_env` or a conda environment.
33
+
2. activate the environment `source virtual_env/bin/activate`
0 commit comments