We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 6e5574d + 31ffaa5 commit 8fd73a4Copy full SHA for 8fd73a4
1 file changed
NeuralAudio/WaveNet.h
@@ -371,7 +371,12 @@ namespace NeuralAudio
371
372
headScale = *(it++);
373
374
- assert(std::distance(weights.begin(), it) == (long)weights.size());
+ if (std::distance(weights.begin(), it) != (long)weights.size())
375
+ {
376
+ std::stringstream str;
377
+ str << "Wrong number of weights. Remaining: " << std::distance(weights.begin(), it);
378
+ throw std::runtime_error(str.str());
379
+ }
380
}
381
382
size_t GetMaxFrames()
@@ -439,4 +444,4 @@ namespace NeuralAudio
439
444
Eigen::Matrix<float, headLayerChannels, WAVENET_MAX_NUM_FRAMES> headArray;
440
445
float headScale;
441
446
};
442
-}
447
+}
0 commit comments