Fixed configuration bug
@@ -96,8 +96,9 @@ class XMLEngineConfigBuilder extends XMLAbstractBuilder {
if (hasAttribute("threads"))
config.setThreads(getIntAttribute("threads"));
- if (hasAttribute("gpus")) {
- NeuralDecoderConfig neuralConfig = nConfig(config);
+ if (config instanceof NeuralDecoderConfig) {
+ NeuralDecoderConfig neuralConfig = (NeuralDecoderConfig) config;
+ if (hasAttribute("gpus"))
neuralConfig.setGPUs(getIntArrayAttribute("gpus"));
if (neuralConfig.isUsingGPUs() && hasAttribute("threads"))
@@ -106,13 +107,5 @@ class XMLEngineConfigBuilder extends XMLAbstractBuilder {
return config;
}
-
- private static NeuralDecoderConfig nConfig(DecoderConfig config) throws ConfigException {
- try {
- return (NeuralDecoderConfig) config;
- } catch (ClassCastException e) {
- throw new ConfigException("Decoder is not neural");
- }
- }
}
}
