| 689 | } |
| 690 | |
| 691 | inline Result validateOptionalNN(const Specification::ModelDescription& description) { |
| 692 | // just need to check that not all inputs are optional |
| 693 | bool hasNotOptional = false; |
| 694 | for (const auto& input : description.input()) { |
| 695 | if (input.type().Type_case() == Specification::FeatureType::kStateType) { // ignore optionality for State type input (which is always non-optional) |
| 696 | hasNotOptional = true; |
| 697 | continue; |
| 698 | } |
| 699 | if (!input.type().isoptional()) { |
| 700 | hasNotOptional = true; |
| 701 | break; |
| 702 | } |
| 703 | } |
| 704 | if (description.input().size() > 0 && !hasNotOptional) { |
| 705 | return Result(ResultType::INVALID_MODEL_PARAMETERS, "At least one feature for a neural network must NOT be optional."); |
| 706 | } |
| 707 | return Result(); |
| 708 | } |
| 709 | |
| 710 | Result validateOptional(const Specification::Model& format) { |
| 711 | Result r; |
no test coverage detected