Remove redunant condition check

This commit is contained in:
Michael Kuchnik 2020-11-02 17:04:48 -05:00
parent a57ecacbcb
commit 6f7d4ecf19

View File

@ -853,21 +853,16 @@ Status InstantiatedCapturedFunction::Run(
node->record_stop(EnvTime::NowNanos()); node->record_stop(EnvTime::NowNanos());
TF_RETURN_IF_ERROR(lib_->RunSync(std::move(f_opts), f_handle_, &frame)); TF_RETURN_IF_ERROR(lib_->RunSync(std::move(f_opts), f_handle_, &frame));
node->record_start(EnvTime::NowNanos()); node->record_start(EnvTime::NowNanos());
if (node) { if (ctx->stats_aggregator()) {
// TODO(b/129085499) Utilize the `node_name` which would be unique string prefix_with_func_name =
// than the prefix for the function execution time statistics. strings::StrCat(node->name(), stats_utils::kDelimiter,
// prefix_with_func_name would then be node_name + func_name. captured_func_->func().name());
if (ctx->stats_aggregator()) { ctx->stats_aggregator()->AddToHistogram(
string prefix_with_func_name = stats_utils::ExecutionTimeHistogramName(prefix_with_func_name),
strings::StrCat(node->name(), stats_utils::kDelimiter, {static_cast<float>(stats_collector->processing_time())},
captured_func_->func().name()); node->num_elements());
ctx->stats_aggregator()->AddToHistogram(
stats_utils::ExecutionTimeHistogramName(prefix_with_func_name),
{static_cast<float>(stats_collector->processing_time())},
node->num_elements());
}
node->add_processing_time(stats_collector->processing_time());
} }
node->add_processing_time(stats_collector->processing_time());
} else { } else {
TF_RETURN_IF_ERROR(lib_->RunSync(std::move(f_opts), f_handle_, &frame)); TF_RETURN_IF_ERROR(lib_->RunSync(std::move(f_opts), f_handle_, &frame));
} }