Skip to content

Incorrect Binding of dither to high_freq in Pybind11 Bindings #1738

Closed
@jacklynblack

Description

Issue:

The dither attribute of the FeatureExtractorConfig class in the Pybind11 bindings seems to be incorrectly tied to the high_freq attribute in the underlying C++ implementation. This causes dither to always reflect the value of high_freq and vice versa, effectively making these two attributes dependent on each other when they should be independent.

Environment:

Affected Class: FeatureExtractorConfig
File: sherpa-onnx/python/csrc/features.cc

Proposed Fix:

The correct binding for dither should refer to its own member variable instead of high_freq. The corrected Pybind11 binding should be:

.def_readwrite("high_freq", &PyClass::high_freq)  // Correct binding for high_freq
.def_readwrite("dither", &PyClass::dither)  // Correct binding for dither

This will ensure that dither is an independent attribute and does not affect or get affected by changes to high_freq.

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