internlm/SWE-Fixer-Train-110K huggingface dataset:
Repository: voxel51/fiftyone

Issue:
[BUG] Sorting by similarity does not work on develop
On `develop`, nothing happens when clicking `Apply` below to sort by similarity in the App:

```py
import fiftyone as fo
import fiftyone.brain as fob
import fiftyone.zoo as foz

dataset = foz.load_zoo_dataset("quickstart")

model = foz.load_zoo_model("clip-vit-base32-torch")
fob.compute_similarity(dataset, model=model, brain_key="clip")

session = fo.launch_app(dataset)
```

<img width="628" alt="Screen Shot 2023-01-30 at 11 32 57 AM" src="https://user-images.githubusercontent.com/25985824/215537611-86a2385a-9279-410d-ac36-4ec5c7537551.png">



Discussion:

Resolving patch:
diff --git a/fiftyone/server/routes/sort.py b/fiftyone/server/routes/sort.py
--- a/fiftyone/server/routes/sort.py
+++ b/fiftyone/server/routes/sort.py
@@ -24,9 +24,7 @@ async def post(self, request: Request, data: dict):
         dataset_name = data.get("dataset", None)
         filters = data.get("filters", {})
         stages = data.get("view", None)
-        extended = data.get("extended", None)
         dist_field = data.get("dist_field", None)
-
         dataset = fod.load_dataset(dataset_name)
 
         changed = False


Test patch:
Repository: voxel51/fiftyone

Issue:
[FR] App should include point cloud slices in group selector when projection metadata is available
When an `OrthographicProjectionMetadata` field exists in the schema of a grouped view, the App should include point cloud slices in the group slice selector, since these slices are, in fact, supported in the grid now!

```py
import fiftyone as fo
import fiftyone.utils.utils3d as fou3d
import fiftyone.zoo as foz

dataset = foz.load_zoo_dataset("quickstart-groups")
view = dataset.select_group_slices("pcd")

fou3d.compute_orthographic_projection_images(view, (-1, 512), "/tmp/proj")

session = fo.launch_app(dataset)
```

The `pcd` slice should be available in the selector:

<img width="1144" alt="Screen Shot 2023-03-04 at 2 44 21 PM" src="https://user-images.githubusercontent.com/25985824/222925758-2b882fb9-d550-40ba-b90e-90cce81d9db3.png">



Discussion:

Resolving patch:
diff --git a/fiftyone/utils/utils3d.py b/fiftyone/utils/utils3d.py
--- a/fiftyone/utils/utils3d.py
+++ b/fiftyone/utils/utils3d.py
@@ -531,8 +531,8 @@ def compute_orthographic_projection_images(
 
     if out_group_slice is not None:
         out_samples = []
-    else:
-        all_metadata = []
+
+    all_metadata = []
 
     with fou.ProgressBar(total=len(filepaths)) as pb:
         for filepath, group in pb(zip(filepaths, groups)):
@@ -557,15 +557,14 @@ def compute_orthographic_projection_images(
                 sample = fos.Sample(filepath=image_path)
                 sample[group_field] = group.element(out_group_slice)
                 sample[metadata_field] = metadata
-
                 out_samples.append(sample)
-            else:
-                all_metadata.append(metadata)
+
+            all_metadata.append(metadata)
 
     if out_group_slice is not None:
         samples.add_samples(out_samples)
-    else:
-        point_cloud_view.set_values(metadata_field, all_metadata)
+
+    point_cloud_view.set_values(metadata_field, all_metadata)
 
 
 def compute_orthographic_projection_image(


Test patch:
Repository: voxel51/fiftyone

Issue:
[BUG] dynamic groups in video-only datasets returns unstable ordering of samples
### Instructions

### System information

-   **OS Platform and Distribution** (e.g., Linux Ubuntu 16.04): macOS 13.4.1
-   **Python version** (`python --version`): 3.10.8
-   **FiftyOne version** (`fiftyone --version`): 0.21.5
-   **FiftyOne installed from** (pip or source): source

### Commands to reproduce

```
import fiftyone as fo
import fiftyone.zoo as foz

dataset = foz.load_zoo_dataset("quickstart-video")
```

### Describe the problem

When creating unordered dynamic groups from the app on image or pcd only datasets, it returns a stable sample collection. But with video datasets, the returned sample collection is unstable and changes in every page refresh. 

### What areas of FiftyOne does this bug affect?

-   [x] `App`: FiftyOne application issue
-   [x] `Core`: Core Python library issue
-   [ ] `Server`: FiftyOne server issue

### Willingness to contribute

-   [x] Yes. I can contribute a fix for this bug independently
-   [ ] Yes. I would be willing to contribute a fix for this bug with guidance from the FiftyOne community
-   [ ] No. I cannot contribute a bug fix at this time



Discussion:
@sashankaryal can you provide an example `group_by()` operation on the `quickstart-video` dataset that demonstrates the instability you're referencing?
Below is the `group_by` view stage associated with this issue. Note that this one is ordered, but we see the same behavior in unordered query as well.

```
  "view": [
    {
      "_cls": "fiftyone.core.stages.GroupBy",
      "kwargs": [
        [
          "field_or_expr",
          "metadata.duration"
        ],
        [
          "order_by",
          "metadata.size_bytes"
        ],
        [
          "reverse",
          false
        ],
        [
          "flat",
          false
        ],
        [
          "match_expr",
          null
        ],
        [
          "sort_expr",
          null
        ],
        [
          "create_index",
          true
        ]
      ],
      "_uuid": "8c4af56f-7cca-4913-b12a-c0e172e0adbe"
    }
  ]
```

Resolving patch:
diff --git a/fiftyone/core/stages.py b/fiftyone/core/stages.py
--- a/fiftyone/core/stages.py
+++ b/fiftyone/core/stages.py
@@ -3437,6 +3437,7 @@ def _make_grouped_pipeline(self, sample_collection):
 
         pipeline = []
 
+        # sort so that first document in each group comes from a sorted list
         if self._sort_stage is not None:
             pipeline.extend(self._sort_stage.to_mongo(sample_collection))
 
@@ -3447,6 +3448,10 @@ def _make_grouped_pipeline(self, sample_collection):
             ]
         )
 
+        # add a sort stage so that we return a stable ordering of groups
+        # sort by _id to preserve insertion order
+        pipeline.append({"$sort": {"_id": 1}})
+
         return pipeline
 
     def get_group_expr(self, sample_collection):


Test patch:
Repository: voxel51/fiftyone

Issue:
[FR] Support Ubuntu 24.04
### Proposal Summary

Support [Ubuntu 24.04](https://releases.ubuntu.com/noble/).

### Motivation

For all users eager to work with the latest Ubuntu release, they would see Fiftyone fail because `MongoDB` could not be installed on your system. [MongoDB](https://www.mongodb.com/docs/manual/tutorial/install-mongodb-on-ubuntu/) does not support Ubuntu 24.04 yet, but it would be very nice to have Fiftyone working again out-of-the-box when MongoDB is ready!

### What areas of FiftyOne does this feature affect?

-   [ ] App: FiftyOne application
-   [x] Core: Core `fiftyone` Python library
-   [ ] Server: FiftyOne server

### Details

We don't know how long it takes for MongoDB to support Ubuntu 24.04.

### Willingness to contribute

The FiftyOne Community welcomes contributions! Would you or another member of your organization be willing to contribute an implementation of this feature?

-   [ ] Yes. I can contribute this feature independently
-   [ ] Yes. I would be willing to contribute this feature with guidance from the FiftyOne community
-   [x] No. I cannot contribute this feature at this time



Discussion:
Hi @TvdrBurgt. A [MongoDB URI](https://docs.voxel51.com/user_guide/config.html#configuring-a-mongodb-connection) can be configured for systems without a compatible built-in `fiftyone-db` binary.

If you are able to confirm MongoDB 22.04 works on 24.04 we can add built-in support for Ubuntu 22.04
Seems like mongo db isn't officially supported on 24.04 yet. I was able to install it using

```
echo "deb [ arch=amd64,arm64 signed-by=/usr/share/keyrings/mongodb-server-7.0.gpg ] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/7.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-7.0.list
sudo apt install -y mongodb-org
```
Fiftyone work as expected after that

Resolving patch:
diff --git a/package/db/setup.py b/package/db/setup.py
--- a/package/db/setup.py
+++ b/package/db/setup.py
@@ -95,6 +95,10 @@
             "aarch64": "https://fastdl.mongodb.org/linux/mongodb-linux-aarch64-ubuntu2204-7.0.4.tgz",
             "x86_64": "https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu2204-7.0.4.tgz",
         },
+        "24": {
+            "aarch64": "https://fastdl.mongodb.org/linux/mongodb-linux-aarch64-ubuntu2204-7.0.4.tgz",
+            "x86_64": "https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu2204-7.0.4.tgz",
+        },
     },
 }
 
@@ -139,7 +143,7 @@ def _get_download():
 MONGODB_BINARIES = ["mongod"]
 
 
-VERSION = "1.1.3"
+VERSION = "1.1.4"
 
 
 def get_version():


Test patch:
Repository: pytorch/audio

Issue:
Need API for saving to file.
Currently we only have a load function. But after training the network it would be great if we can save the generated tensor to a file.

@soumith I think we can reuse a lot of code from this repo https://github.com/MattVitelli/GRUV


Discussion:

Resolving patch:
diff --git a/torchaudio/__init__.py b/torchaudio/__init__.py
--- a/torchaudio/__init__.py
+++ b/torchaudio/__init__.py
@@ -1,32 +1,40 @@
+import os
+
 import torch
 
 from cffi import FFI
+
 ffi = FFI()
 from ._ext import th_sox
 
+
+def check_input(src):
+    if not torch.is_tensor(src):
+        raise TypeError('Expected a tensor, got %s' % type(src))
+    if not src.__module__ == 'torch':
+        raise TypeError('Expected a CPU based tensor, got %s' % type(src))
+
+
 def load(filename, out=None):
     if out is not None:
-        assert torch.is_tensor(out)
-        assert not out.is_cuda
+        check_input(out)
     else:
         out = torch.FloatTensor()
-
-    if isinstance(out, torch.FloatTensor):
-        func = th_sox.libthsox_Float_read_audio_file
-    elif isinstance(out, torch.DoubleTensor):
-        func = th_sox.libthsox_Double_read_audio_file
-    elif isinstance(out, torch.ByteTensor):
-        func = th_sox.libthsox_Byte_read_audio_file
-    elif isinstance(out, torch.CharTensor):
-        func = th_sox.libthsox_Char_read_audio_file
-    elif isinstance(out, torch.ShortTensor):
-        func = th_sox.libthsox_Short_read_audio_file
-    elif isinstance(out, torch.IntTensor):
-        func = th_sox.libthsox_Int_read_audio_file
-    elif isinstance(out, torch.LongTensor):
-        func = th_sox.libthsox_Long_read_audio_file
-        
-    sample_rate_p = ffi.new('int*')    
+    typename = type(out).__name__.replace('Tensor', '')
+    func = getattr(th_sox, 'libthsox_{}_read_audio_file'.format(typename))
+    sample_rate_p = ffi.new('int*')
     func(bytes(filename), out, sample_rate_p)
     sample_rate = sample_rate_p[0]
     return out, sample_rate
+
+
+def save(filepath, src, sample_rate):
+    filename, extension = os.path.splitext(filepath)
+    if type(sample_rate) != int:
+        raise TypeError('Sample rate should be a integer')
+
+    check_input(src)
+    typename = type(src).__name__.replace('Tensor', '')
+    func = getattr(th_sox, 'libthsox_{}_write_audio_file'.format(typename))
+
+    func(bytes(filepath), src, extension[1:], sample_rate)


Test patch:
Repository: pytorch/audio

Issue:
Remove _docs.py
In https://github.com/pytorch/audio/pull/166, we add _docs.py because we can't get the doc string of a class in a `@torch.jit.script_method` without creating an instance (e.g using the syntax `Class.method.__doc__`).
So the workaround is to have _docs.py
```
class Spectrogram:
    forward = torchaudio.transforms.Spectrogram().forward
```
This creates an instance to expose the docstring to sphinx. 
An issue has been made for the pytorch jit https://github.com/pytorch/pytorch/issues/23394
Remove _docs.py
In https://github.com/pytorch/audio/pull/166, we add _docs.py because we can't get the doc string of a class in a `@torch.jit.script_method` without creating an instance (e.g using the syntax `Class.method.__doc__`).
So the workaround is to have _docs.py
```
class Spectrogram:
    forward = torchaudio.transforms.Spectrogram().forward
```
This creates an instance to expose the docstring to sphinx. 
An issue has been made for the pytorch jit https://github.com/pytorch/pytorch/issues/23394


Discussion:

Resolving patch:
diff --git a/torchaudio/__init__.py b/torchaudio/__init__.py
--- a/torchaudio/__init__.py
+++ b/torchaudio/__init__.py
@@ -4,7 +4,7 @@
 import torch
 import _torch_sox
 
-from torchaudio import transforms, datasets, kaldi_io, sox_effects, compliance, _docs
+from torchaudio import transforms, datasets, kaldi_io, sox_effects, compliance
 
 try:
     from .version import __version__, git_version  # noqa: F401
diff --git a/torchaudio/_docs.py b/torchaudio/_docs.py
deleted file mode 100644
--- a/torchaudio/_docs.py
+++ /dev/null
@@ -1,36 +0,0 @@
-from __future__ import absolute_import, division, print_function, unicode_literals
-import torchaudio
-
-
-# TODO See https://github.com/pytorch/audio/issues/165
-class Spectrogram:
-    forward = torchaudio.transforms.Spectrogram().forward
-
-
-class AmplitudeToDB:
-    forward = torchaudio.transforms.AmplitudeToDB().forward
-
-
-class MelScale:
-    forward = torchaudio.transforms.MelScale().forward
-
-
-class MelSpectrogram:
-    forward = torchaudio.transforms.MelSpectrogram().forward
-
-
-class MFCC:
-    forward = torchaudio.transforms.MFCC().forward
-
-
-class MuLawEncoding:
-    forward = torchaudio.transforms.MuLawEncoding().forward
-
-
-class MuLawDecoding:
-    forward = torchaudio.transforms.MuLawDecoding().forward
-
-
-class Resample:
-    # Resample isn't a script_method
-    forward = torchaudio.transforms.Resample.forward


Test patch:
Repository: pytorch/audio

Issue:
Resample Batch of Waveforms 
Hello,
I would like to use the `Resample` class for up/down sampling the learned features during the training. Exactly the same way as `F.interpolate`. However, the batch dimension is not accepted by the `Resample` class so that I need to reshape the tensor to have only the channel and temporal dimensions.

Any help on how to resample a batch of waveforms/multi-channel features without any need to reshape?

Thanks in advance.


Discussion:

Resolving patch:
diff --git a/torchaudio/transforms.py b/torchaudio/transforms.py
--- a/torchaudio/transforms.py
+++ b/torchaudio/transforms.py
@@ -445,7 +445,17 @@ def forward(self, waveform):
             torch.Tensor: Output signal of dimension (..., time)
         """
         if self.resampling_method == 'sinc_interpolation':
-            return kaldi.resample_waveform(waveform, self.orig_freq, self.new_freq)
+
+            # pack batch
+            shape = waveform.size()
+            waveform = waveform.view(-1, shape[-1])
+
+            waveform = kaldi.resample_waveform(waveform, self.orig_freq, self.new_freq)
+
+            # unpack batch
+            waveform = waveform.view(shape[:-1] + waveform.shape[-1:])
+
+            return waveform
 
         raise ValueError('Invalid resampling method: %s' % (self.resampling_method))
 


Test patch:
diff --git a/test/test_transforms.py b/test/test_transforms.py
--- a/test/test_transforms.py
+++ b/test/test_transforms.py
@@ -326,6 +326,18 @@ def test_scriptmodule_Resample(self):
 
         _test_script_module(transforms.Spectrogram, tensor, sample_rate, sample_rate_2)
 
+    def test_batch_Resample(self):
+        waveform = torch.randn(2, 2786)
+
+        # Single then transform then batch
+        expected = transforms.Resample()(waveform).repeat(3, 1, 1)
+
+        # Batch then transform
+        computed = transforms.Resample()(waveform.repeat(3, 1, 1))
+
+        self.assertTrue(computed.shape == expected.shape, (computed.shape, expected.shape))
+        self.assertTrue(torch.allclose(computed, expected))
+
     def test_scriptmodule_ComplexNorm(self):
         tensor = torch.rand((1, 2, 201, 2))
         _test_script_module(transforms.ComplexNorm, tensor)
Repository: pytorch/audio

Issue:
fix test_scriptmodule_Resample
Currently, when calling `test_scriptmodule_Resample` it is testing `transforms.Spectrogram` instead of `transforms.Resample`


Discussion:

Resolving patch:
diff --git a/torchaudio/compliance/kaldi.py b/torchaudio/compliance/kaldi.py
--- a/torchaudio/compliance/kaldi.py
+++ b/torchaudio/compliance/kaldi.py
@@ -32,22 +32,6 @@
 WINDOWS = [HAMMING, HANNING, POVEY, RECTANGULAR, BLACKMAN]
 
 
-def gcd(a, b):
-    # type: (int, int) -> int
-    """Calculate the Greatest Common Divisor of a and b.
-
-    Unless b==0, the result will have the same sign as b (so that when
-    b is divided by it, the result comes out positive).
-    """
-
-    try:
-        return math.gcd(a, b)
-    except AttributeError:
-        while b:
-            a, b = b, a % b
-        return a
-
-
 def _next_power_of_2(x):
     r"""Returns the smallest power of 2 that is greater than x
     """
@@ -749,7 +733,7 @@ def _get_LR_indices_and_weights(orig_freq, new_freq, output_samples_in_unit, win
 
 def _lcm(a, b):
     # type: (int, int) -> int
-    return abs(a * b) // gcd(a, b)
+    return abs(a * b) // math.gcd(a, b)
 
 
 def _get_num_LR_output_samples(input_num_samp, samp_rate_in, samp_rate_out):
@@ -826,7 +810,7 @@ def resample_waveform(waveform, orig_freq, new_freq, lowpass_filter_width=6):
 
     assert lowpass_cutoff * 2 <= min_freq
 
-    base_freq = gcd(int(orig_freq), int(new_freq))
+    base_freq = math.gcd(int(orig_freq), int(new_freq))
     input_samples_in_unit = int(orig_freq) // base_freq
     output_samples_in_unit = int(new_freq) // base_freq
 


Test patch:
diff --git a/test/test_transforms.py b/test/test_transforms.py
--- a/test/test_transforms.py
+++ b/test/test_transforms.py
@@ -321,10 +321,10 @@ def _test_librosa_consistency_helper(n_fft, hop_length, power, n_mels, n_mfcc, s
 
     def test_scriptmodule_Resample(self):
         tensor = torch.rand((2, 1000))
-        sample_rate = 100
-        sample_rate_2 = 50
+        sample_rate = 100.
+        sample_rate_2 = 50.
 
-        _test_script_module(transforms.Spectrogram, tensor, sample_rate, sample_rate_2)
+        _test_script_module(transforms.Resample, tensor, sample_rate, sample_rate_2)
 
     def test_batch_Resample(self):
         waveform = torch.randn(2, 2786)
Repository: pytorch/audio

Issue:
Migrate TimeStretch and AmplitudeToDB to torch.nn.Module
As mentioned in #314, now that python 2 has been deprecated, `TimeStretch` and `AmplitudeToDB` need to be migrated from `torch.jit.ScriptModule` to `torch.nn.Module`.


Discussion:

Resolving patch:
diff --git a/torchaudio/transforms.py b/torchaudio/transforms.py
--- a/torchaudio/transforms.py
+++ b/torchaudio/transforms.py
@@ -137,7 +137,7 @@ def forward(self, S):
                             self.normalized, self.n_iter, self.momentum, self.length, self.rand_init)
 
 
-class AmplitudeToDB(torch.jit.ScriptModule):
+class AmplitudeToDB(torch.nn.Module):
     r"""Turn a tensor from the power/amplitude scale to the decibel scale.
 
     This output depends on the maximum value in the input tensor, and so
@@ -157,7 +157,7 @@ def __init__(self, stype='power', top_db=None):
         self.stype = stype
         if top_db is not None and top_db < 0:
             raise ValueError('top_db must be positive value')
-        self.top_db = torch.jit.Attribute(top_db, Optional[float])
+        self.top_db = top_db
         self.multiplier = 10.0 if stype == 'power' else 20.0
         self.amin = 1e-10
         self.ref_value = 1.0
@@ -592,7 +592,7 @@ def forward(self, specgram):
         return F.compute_deltas(specgram, win_length=self.win_length, mode=self.mode)
 
 
-class TimeStretch(torch.jit.ScriptModule):
+class TimeStretch(torch.nn.Module):
     r"""Stretch stft in time without modifying pitch for a given rate.
 
     Args:
@@ -610,8 +610,7 @@ def __init__(self, hop_length=None, n_freq=201, fixed_rate=None):
 
         n_fft = (n_freq - 1) * 2
         hop_length = hop_length if hop_length is not None else n_fft // 2
-        phase_advance = torch.linspace(0, math.pi * hop_length, n_freq)[..., None]
-        self.phase_advance = torch.jit.Attribute(phase_advance, torch.Tensor)
+        self.phase_advance = torch.linspace(0, math.pi * hop_length, n_freq)[..., None]
 
     def forward(self, complex_specgrams, overriding_rate=None):
         # type: (Tensor, Optional[float]) -> Tensor


Test patch:
Repository: pytorch/audio

Issue:
Configurable "power" of Spectrogram inside MelSpectrogram
## 🚀 Feature
Right now the Spectrogram inside MelSpectrogram uses power 2 by default and this can't be modified when instantiating MelSpectrogram. Can we make it configurable as an argument of MelSpectrogram?

## Motivation
Some implementations of MelSpectrogram use power 1 (for example the VGGish code) while some use power 2. It's better to make it configurable when replicating others work.


## Pitch

https://github.com/pytorch/audio/blob/00d38203e401b8d9472a8f8394a10e2c309be02c/torchaudio/transforms.py#L408-L411

Here, can we make both "power" and "normalized" configurable rather than fixing them?

## Alternatives


## Additional context

VGGish's melspectrogram implementation
https://github.com/tensorflow/models/blob/0fc994b6762b7bfe971cc9f370b40d2cd987fb66/research/audioset/vggish/mel_features.py#L92



Discussion:
Good idea! Do you want to open a PR to expose the power parameter with a default value of 2?
> Good idea! Do you want to open a PR to expose the power parameter with a default value of 2?

Glad to do that!

Resolving patch:
diff --git a/torchaudio/transforms.py b/torchaudio/transforms.py
--- a/torchaudio/transforms.py
+++ b/torchaudio/transforms.py
@@ -395,6 +395,8 @@ def __init__(self,
                  pad: int = 0,
                  n_mels: int = 128,
                  window_fn: Callable[..., Tensor] = torch.hann_window,
+                 power: Optional[float] = 2.,
+                 normalized: bool = False,
                  wkwargs: Optional[dict] = None) -> None:
         super(MelSpectrogram, self).__init__()
         self.sample_rate = sample_rate
@@ -402,13 +404,15 @@ def __init__(self,
         self.win_length = win_length if win_length is not None else n_fft
         self.hop_length = hop_length if hop_length is not None else self.win_length // 2
         self.pad = pad
+        self.power = power
+        self.normalized = normalized
         self.n_mels = n_mels  # number of mel frequency bins
         self.f_max = f_max
         self.f_min = f_min
         self.spectrogram = Spectrogram(n_fft=self.n_fft, win_length=self.win_length,
                                        hop_length=self.hop_length,
-                                       pad=self.pad, window_fn=window_fn, power=2.,
-                                       normalized=False, wkwargs=wkwargs)
+                                       pad=self.pad, window_fn=window_fn, power=self.power,
+                                       normalized=self.normalized, wkwargs=wkwargs)
         self.mel_scale = MelScale(self.n_mels, self.sample_rate, self.f_min, self.f_max, self.n_fft // 2 + 1)
 
     def forward(self, waveform: Tensor) -> Tensor:


Test patch:
Repository: pytorch/audio

Issue:
multiple definitions of `SoxEffect`.
`SoxEffect` is defined both in

https://github.com/pytorch/audio/blob/00d38203e401b8d9472a8f8394a10e2c309be02c/torchaudio/torch_sox.h#L50-L54

and

https://github.com/pytorch/audio/blob/00d38203e401b8d9472a8f8394a10e2c309be02c/torchaudio/torch_sox.cpp#L73-L77


-----

-----

`torch_sox.h` can be included into `torch_sox.cpp` so that `SoxEffect` needs to be defined
only once in the header.


Discussion:
Good catch. Do you want to open a PR for this?

Resolving patch:
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -88,7 +88,7 @@ def check_env_flag(name, default=''):
             '_torch_sox',
             ['torchaudio/torch_sox.cpp'],
             libraries=libraries,
-            include_dirs=include_dirs,
+            include_dirs=include_dirs + [cwd],
             extra_compile_args=eca,
             extra_objects=extra_objects,
             extra_link_args=ela),


Test patch: