Skip to content

Commit

Permalink
Skip over optional bias tensors.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 284767966
Change-Id: Ib198cf71b970504dd424c0a0db487bd3103012af
  • Loading branch information
tensorflower-gardener committed Dec 10, 2019
1 parent 3dedec0 commit 84add98
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tensorflow/lite/tools/optimize/quantize_model.cc
Original file line number Diff line number Diff line change
Expand Up @@ -993,6 +993,9 @@ TfLiteStatus EnsureBiasScaleCompatibility(

// Loop over all bias tensors.
for (const int bias_idx : property.biases) {
if (op->inputs[bias_idx] == kTfLiteOptionalTensor) {
continue;
}
TensorT* bias_tensor = subgraph->tensors[op->inputs[bias_idx]].get();
int32_t channel_dim_size = bias_tensor->shape[0];
if (bias_tensor->shape.size() != 1) {
Expand Down

0 comments on commit 84add98

Please sign in to comment.