Skip to content
This repository was archived by the owner on Aug 12, 2025. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions tensorflow/compiler/tf2xla/const_analysis.cc
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,15 @@ Status GetFunctionBodies(FunctionLibraryRuntime* flib_runtime,

Status CondConstInputIndices(
absl::Span<const FunctionBody* const> branch_bodies,
std::vector<int>* const_input_idxs, FunctionLibraryRuntime* flib_runtime) {
TF_RET_CHECK(!branch_bodies.empty());

TF_RET_CHECK(branch_bodies[0] != nullptr);
std::vector<int>* const_input_idxs, FunctionLibraryRuntime* flib_runtime) {
TF_RET_CHECK(!branch_bodies.empty() && branch_bodies[0] != nullptr);

int num_inputs = branch_bodies[0]->fdef.signature().input_arg_size();
// Stores indices of the "branch function" inputs that are expected to be
// compile time constants.
std::vector<bool> compile_time_const_arg_indices(num_inputs);
std::vector<bool> compile_time_const_arg_indices(num_inputs, false);
for (auto fbody : branch_bodies) {
TF_RET_CHECK(fbody != nullptr);
TF_RETURN_IF_ERROR(BackwardsConstAnalysis(
Expand Down