Skip to content

Commit c42b9f7

Browse files
committed
Fix comment, thanks @saksham189!
1 parent 7dabe28 commit c42b9f7

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/mlpack/methods/ann/brnn_impl.hpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,9 @@ template<typename OutputLayerType, typename MergeLayerType,
6666
BRNN<OutputLayerType, MergeLayerType, MergeOutputType,
6767
InitializationRuleType, CustomLayers...>::~BRNN()
6868
{
69-
// Remove mergeLayer from the forward and backward RNNs so it doesn't get
70-
// deleted. This assumes that mergeLayer is the last layer!
69+
// Remove the last layers from the forward and backward RNNs, as they are held
70+
// in mergeLayer. So, when we use DeleteVisitor with mergeLayer, those two
71+
// layers will be properly (and not doubly) freed.
7172
forwardRNN.network.pop_back();
7273
backwardRNN.network.pop_back();
7374

0 commit comments

Comments
 (0)