Skip to content

Commit ea02141

Browse files
tf-marissawtensorflow-copybara
authored andcommitted
Add the batch_padding_policy attribute the tensorflow serving api.
Original author is piatov@ PiperOrigin-RevId: 658548835
1 parent 9ba72fa commit ea02141

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

tensorflow_serving/servables/tensorflow/tfrt_saved_model_factory.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,7 @@ absl::Status TfrtSavedModelFactory::CreateTfrtSavedModelWithMetadata(
238238
compile_options.min_num_batch_threads = config_.tfrt_min_num_batch_threads();
239239
compile_options.min_max_enqueued_batches =
240240
config_.tfrt_min_max_enqueued_batches();
241+
compile_options.batch_padding_policy = config_.batch_padding_policy();
241242

242243
options.graph_execution_options.run_placer_grappler_on_functions =
243244
config_.run_placer_grappler_on_functions();

tensorflow_serving/servables/tensorflow/tfrt_saved_model_source_adapter.proto

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,11 @@ message TfrtSavedModelConfig {
224224

225225
// The minimum of the maximum number of outstanding enqueue batches
226226
int64 tfrt_min_max_enqueued_batches = 2025;
227+
228+
// The policy used by a BatchScheduler to pad (or split) batches.
229+
// See the description of the batch_padding_policy attribute of
230+
// BatchFunction in core/ops/batch_ops.cc.
231+
string batch_padding_policy = 2026;
227232
}
228233

229234
// Config proto for TfrtSavedModelSourceAdapter.

0 commit comments

Comments
 (0)