Remove "conversion to scalar" hack.
@@ -116,12 +116,6 @@ def main():
test_iterator = SerialIterator(test, 16, repeat=False, shuffle=False)
eval_result = Evaluator(test_iterator, model, converter=concat_mols,
device=args.gpu)()
-
- # Prevents the loss function from becoming a cupy.core.core.ndarray object
- # when using the GPU. This hack will be removed as soon as the cause of
- # the issue is found and properly fixed.
- loss = numpy.asscalar(cuda.to_cpu(eval_result['main/loss']))
- eval_result['main/loss'] = loss
print('Evaluation result: ', eval_result)
# Save the evaluation results.
