The "BeamSearchDecoderCTC" code has potential memory leaks. Even though the decoder object was removed (by calling "__del__" function), memory deallocation may not be achieved neatly, and I have experienced this issue.
To deallocate memory for the decoder, the "cleanup" function must be explicitly called. Instead, when the "__del__" function is called, it seems natural to have the "cleanup" function also called.
The "BeamSearchDecoderCTC" code has potential memory leaks. Even though the decoder object was removed (by calling "__del__" function), memory deallocation may not be achieved neatly, and I have experienced this issue. To deallocate memory for the decoder, the "cleanup" function must be explicitly called. Instead, when the "__del__" function is called, it seems natural to have the "cleanup" function also called.