| 340 | } |
| 341 | |
| 342 | Specification::Pipeline* buildEmptyPipelineModel(Specification::Model& m, bool isUpdatable, const TensorAttributes *inTensorAttr, const TensorAttributes *outTensorAttr) { |
| 343 | auto inTensor = m.mutable_description()->add_input(); |
| 344 | inTensor->set_name(inTensorAttr->name); |
| 345 | auto inTensorShape = inTensor->mutable_type()->mutable_multiarraytype(); |
| 346 | inTensorShape->set_datatype(Specification::ArrayFeatureType_ArrayDataType_FLOAT32); |
| 347 | for (int i = 0; i < inTensorAttr->dimension; i++) { |
| 348 | inTensorShape->add_shape(1); |
| 349 | } |
| 350 | |
| 351 | auto outTensor = m.mutable_description()->add_output(); |
| 352 | outTensor->set_name(outTensorAttr->name); |
| 353 | auto outTensorShape = outTensor->mutable_type()->mutable_multiarraytype(); |
| 354 | outTensorShape->set_datatype(Specification::ArrayFeatureType_ArrayDataType_FLOAT32); |
| 355 | for (int i = 0; i < outTensorAttr->dimension; i++) { |
| 356 | outTensorShape->add_shape(1); |
| 357 | } |
| 358 | |
| 359 | m.set_specificationversion(MLMODEL_SPECIFICATION_VERSION_IOS13); |
| 360 | |
| 361 | auto pipeline = m.mutable_pipeline(); |
| 362 | |
| 363 | if (isUpdatable) { |
| 364 | m.set_isupdatable(true); |
| 365 | } |
| 366 | |
| 367 | return pipeline; |
| 368 | } |
| 369 | |
| 370 | Specification::Pipeline* buildEmptyPipelineModelWithStringOutput(Specification::Model& m, bool isUpdatable, const TensorAttributes *inTensorAttr, const char *outTensorName) { |
| 371 | auto inTensor = m.mutable_description()->add_input(); |