Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Combined TF_RET_CHECK condition and initialised compile_time_const_ar… #102

Open
wants to merge 1 commit into
base: r1.15.5+nv23.03
Choose a base branch
from
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