diff options
author | A. Unique TensorFlower <gardener@tensorflow.org> | 2018-10-02 12:41:31 -0700 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2018-10-02 12:51:27 -0700 |
commit | 508dd179b6b6dd78aa3e24212648789e8fc018a0 (patch) | |
tree | 35f5678189fe4b10a0af0592ae61e3e7dcdcb8be /tensorflow/contrib/lite/toco/tooling_util.cc | |
parent | d3e830e608211bc81cfb111abe3c0357bd92a12e (diff) |
Allow passing --allow_nonexistent_arrays via toco_convert
PiperOrigin-RevId: 215440829
Diffstat (limited to 'tensorflow/contrib/lite/toco/tooling_util.cc')
-rw-r--r-- | tensorflow/contrib/lite/toco/tooling_util.cc | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/tensorflow/contrib/lite/toco/tooling_util.cc b/tensorflow/contrib/lite/toco/tooling_util.cc index b87e01fbf0..e3f27e9e2a 100644 --- a/tensorflow/contrib/lite/toco/tooling_util.cc +++ b/tensorflow/contrib/lite/toco/tooling_util.cc @@ -852,27 +852,30 @@ void CheckNonExistentIOArrays(const Model& model) { if (model.flags.allow_nonexistent_arrays()) { return; } + static constexpr char general_comment[] = + "Is it a typo? To silence this message, pass this flag: " + "allow_nonexistent_arrays"; for (const auto& input_array : model.flags.input_arrays()) { QCHECK(GetOpWithInput(model, input_array.name())) - << "Specified input array " << input_array.name() - << " is not consumed by any op in this graph. Is it a typo?"; + << "Specified input array \"" << input_array.name() + << "\" is not consumed by any op in this graph. " << general_comment; } for (const string& output_array : model.flags.output_arrays()) { QCHECK(GetOpWithOutput(model, output_array)) - << "Specified output array " << output_array - << " is not produced by any op in this graph. Is it a typo?"; + << "Specified output array \"" << output_array + << "\" is not produced by any op in this graph. " << general_comment; } for (const auto& rnn_state : model.flags.rnn_states()) { if (!rnn_state.discardable()) { // Check that all RNN states are consumed QCHECK(GetOpWithInput(model, rnn_state.state_array())) - << "Specified RNN state " << rnn_state.state_array() - << " is not consumed by any op in this graph. Is it a typo?"; + << "Specified RNN state \"" << rnn_state.state_array() + << "\" is not consumed by any op in this graph. " << general_comment; // Check that all RNN back-edge source arrays are produced QCHECK(GetOpWithOutput(model, rnn_state.back_edge_source_array())) - << "Specified RNN back-edge source array " + << "Specified RNN back-edge source array \"" << rnn_state.back_edge_source_array() - << " is not produced by any op in this graph. Is it a typo?"; + << "\" is not produced by any op in this graph. " << general_comment; } } } |