// Convenience wrapper around predict for models with // single tensor outputs of shape (1, 1, 1), // typically used for regression or binary classification. // Returns this one activation value. float_type predict_single_output(const tensor5s& inputs) const { const tensor5s outputs = predict(inputs); internal::assertion(outputs.size() == 1, "invalid number of outputs"); const auto output_shape = outputs.front().shape(); internal::assertion(output_shape.volume() == 1, "invalid output shape"); return outputs.front().get(0, 0, 0, 0, 0); }
convert tensor5 datatype to std::vectorapp
const std::vector<float> result_vec = *result.front().as_vector();