Skip to content

Commit

Permalink
Merge branch 'feature/add-support-to-multiple-batch-size' into dev-0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
GFallasRR committed Jun 5, 2019
2 parents a9e43eb + 56b2793 commit 509c831
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
9 changes: 4 additions & 5 deletions r2i/tensorflow/frame.cc
Original file line number Diff line number Diff line change
Expand Up @@ -191,11 +191,10 @@ RuntimeError Frame::GetTensorShape (std::shared_ptr<TF_Graph> pgraph,
return error;
}

/* Some tensors may refer to generic batch sizes as -1. If this is the case
fallback to 1 */
if (-1 == (*dims)[0]) {
(*dims)[0] = 1;
}
/* R2Inference uses a batch size of 1 but some tensors have this value set to
* generic (-1) or greater than 1.
* Batch size set to 1 for general compatibility support. */
(*dims)[0] = 1;

type = TF_OperationOutputType(output);
size = TF_DataTypeSize(type);
Expand Down
9 changes: 4 additions & 5 deletions r2i/tensorflow/prediction.cc
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,10 @@ RuntimeError Prediction::SetTensor (std::shared_ptr<TF_Graph> pgraph,
return error;
}

/* Some tensors may refer to generic batch sizes as -1. If this is the case
fallback to 1 */
if (-1 == dims[0]) {
dims[0] = 1;
}
/* R2Inference uses a batch size of 1 but some tensors have this value set to
* generic (-1) or greater than 1.
* Batch size set to 1 for general compatibility support. */
dims[0] = 1;

TF_DataType type = TF_OperationOutputType(output);
size_t type_size = TF_DataTypeSize(type);
Expand Down

0 comments on commit 509c831

Please sign in to comment.