Skip to content

MelScale should retain n_stft as an attribute #4122

@sammlapp

Description

@sammlapp

🐛 Describe the bug

The issue with not retaining this argument as an attribute is that it makes an identical object difficult to recreate from the object's attributes. Setting self.n_stft=n_stft during __init__ will make it so that the same object could be re-initialized from the object's attributes (for instance, if we seralize the object to json)

Versions

Collecting environment information...
PyTorch version: 2.8.0
Is debug build: False
CUDA used to build PyTorch: None
ROCM used to build PyTorch: N/A

OS: macOS 15.1 (arm64)
GCC version: Could not collect
Clang version: 16.0.0 (clang-1600.0.26.4)
CMake version: Could not collect
Libc version: N/A

Python version: 3.13.5 | packaged by Anaconda, Inc. | (main, Jun 12 2025, 11:23:37) [Clang 14.0.6 ] (64-bit runtime)
Python platform: macOS-15.1-arm64-arm-64bit-Mach-O
Is CUDA available: False
CUDA runtime version: No CUDA
CUDA_MODULE_LOADING set to: N/A
GPU models and configuration: No CUDA
Nvidia driver version: No CUDA
cuDNN version: No CUDA
Is XPU available: False
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True

CPU:
Apple M1 Pro

Versions of relevant libraries:
[pip3] mypy_extensions==1.1.0
[pip3] numpy==2.2.0
[pip3] onnx==1.19.1
[pip3] onnx-ir==0.1.11
[pip3] onnxruntime==1.23.2
[pip3] onnxscript==0.5.4
[pip3] pytorch-lightning==2.5.2
[pip3] torch==2.8.0
[pip3] torchaudio==2.8.0
[pip3] torchmetrics==1.8.0
[pip3] torchvision==0.23.0
[conda] numpy 2.2.0 pypi_0 pypi
[conda] pytorch-lightning 2.5.2 pypi_0 pypi
[conda] torch 2.8.0 pypi_0 pypi
[conda] torchaudio 2.8.0 pypi_0 pypi
[conda] torchmetrics 1.8.0 pypi_0 pypi
[conda] torchvision 0.23.0 pypi_0 pypi

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions