As we've discussed in https://github.sec.samsung.net/STAR/nnfw/pull/809#discussion_r48662, once this helper was merged for easy to review, and then we've planed rearrange the order to easy to read in another PR.
This is why I make this PR.
Signed-off-by: sjsujinkim <sjsujin.kim@samsung.com>
const uint32_t MAX_NUMBER_OF_OPERANDS = 0xFFFFFFFE;
const uint32_t MAX_NUMBER_OF_OPERATIONS = 0xFFFFFFFE;
+bool ModelBuilder::badState(const char* name) {
+ if (mCompletedModel) {
+ LOG(ERROR) << "ANeuralNetworksModel_" << name << " can't modify after model finished";
+ return true;
+ }
+ if (mInvalidModel) {
+ LOG(ERROR) << "ANeuralNetworksModel_" << name << " can't modify an invalid model";
+ return true;
+ }
+ return false;
+}
+
int ModelBuilder::addOperand(const ANeuralNetworksOperandType& type) {
if (badState("addOperand")) {
return ANEURALNETWORKS_BAD_STATE;
}
}
-bool ModelBuilder::badState(const char* name) {
- if (mCompletedModel) {
- LOG(ERROR) << "ANeuralNetworksModel_" << name << " can't modify after model finished";
- return true;
- }
- if (mInvalidModel) {
- LOG(ERROR) << "ANeuralNetworksModel_" << name << " can't modify an invalid model";
- return true;
- }
- return false;
-}
-
} // namespace nn
} // namespace android