Merge pull request #31075 from Huawei-MRC-OSI:patch-1

PiperOrigin-RevId: 260560918
This commit is contained in:
TensorFlower Gardener 2019-07-29 13:36:09 -07:00
commit 5ff60ad52a
6 changed files with 6 additions and 6 deletions

View File

@ -207,7 +207,7 @@ void UpdateStats(OpKernelContext* context,
absl::optional<AllocatorStats> allocator_stats =
allocator_pair.first->GetStats();
if (stats) {
if (allocator_stats) {
memory->set_allocator_bytes_in_use(allocator_stats->bytes_in_use);
}
allocator_pair.second->GetRecordsAndUnRef();

View File

@ -1246,7 +1246,7 @@ Status FunctionLibraryRuntimeImpl::Clone(
env_, graph_def_version_, optimizer_.options(), custom_kernel_creator_,
out_lib_def, out_pflr, skip_flib_def));
*out_flr = (*out_pflr)->GetFLR(device_->name());
if (out_flr != nullptr) {
if (*out_flr != nullptr) {
return Status::OK();
} else {
return errors::Internal("Cloning FunctionLibraryRuntime failed.");

View File

@ -866,7 +866,7 @@ class HoistCommonFactorOutOfAggregation : public ArithmeticOptimizerStage {
*shapes_match = true;
unique_factors->reserve(node->input_size());
for (int i = 0; i < node->input_size() && shapes_match; ++i) {
for (int i = 0; i < node->input_size() && *shapes_match; ++i) {
const string& input = node->input(i);
if (IsControlInput(input)) {
break;

View File

@ -95,7 +95,7 @@ Status ShapeOptimizer::Optimize(Cluster* cluster, const GrapplerItem& item,
}
const auto& prop =
properties.GetOutputProperties(reduce_indices.node->name());
if (prop.size() < reduce_indices.port_id) {
if (prop.size() <= reduce_indices.port_id) {
continue;
}
const TensorShapeProto& reduction_indices_shape =

View File

@ -96,7 +96,7 @@ double stirling_approx_tail(double k) {
return kTailValues[static_cast<int>(k)];
}
double kp1sq = (k + 1) * (k + 1);
return (1 / 12 - (1 / 360 + 1 / 1260 / kp1sq) / kp1sq) / (k + 1);
return (1.0 / 12 - (1.0 / 360 + 1.0 / 1260 / kp1sq) / kp1sq) / (k + 1);
}
// We use a transformation-rejection algorithm from

View File

@ -1927,7 +1927,7 @@ tensorflow::Status ConvertTransposeConvOperator(
<< "Dilation unsupported in TransposeConv. TensorFlow op \""
<< node.name() << "\" had dilations";
CHECK((dilations.i(0) == 1) && (dilations.i(1) == 1) &&
(dilations.i(1) == 1) && (dilations.i(3) == 1))
(dilations.i(2) == 1) && (dilations.i(3) == 1))
<< "Dilation unsupported in TransposeConv. TensorFlow op \""
<< node.name() << "\" had dilations:[ " << dilations.i(0) << ", "
<< dilations.i(1) << ", " << dilations.i(2) << ", " << dilations.i(3)