toco_flags.output_format = toco_flags_pb2.TFLITE
toco_flags.inference_input_type = types_pb2.FLOAT
toco_flags.inference_type = types_pb2.FLOAT
+ toco_flags.allow_custom_ops = True;
model_flags = model_flags_pb2.ModelFlags()
input_array = model_flags.input_arrays.add()
input_array.name = TensorName(in_tensor)
toco::Import(toco_flags, model_flags, input_contents_txt);
toco::Transform(toco_flags, model.get());
string output_file_contents_txt;
- Export(toco_flags, *model, &output_file_contents_txt);
+ Export(toco_flags, *model, toco_flags.allow_custom_ops(),
+ &output_file_contents_txt);
// Convert arguments back to byte (py3) or str (py2)
return TOCO_FROM_CPPSTRING_TO_PY(output_file_contents_txt.data(),