aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar A. Unique TensorFlower <gardener@tensorflow.org>2017-09-01 13:05:00 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2017-09-01 13:09:00 -0700
commit1196fbc824b45679cba9fae8daa35cc6c02d3599 (patch)
tree02c40f8a7d9c3889293921da0c6f7238ca492761
parent9fe71e08a56035dd547f7f9e9f7fdc0b093d0c96 (diff)
Use boolean literals where appropriate instead of narrowing ints
PiperOrigin-RevId: 167314054
-rw-r--r--tensorflow/compiler/xla/service/cpu/parallel_cpu_executable.cc2
-rw-r--r--tensorflow/compiler/xla/service/elemental_ir_emitter.cc2
-rw-r--r--tensorflow/compiler/xla/service/gpu/elemental_ir_emitter.cc2
-rw-r--r--tensorflow/core/framework/cancellation.cc4
-rw-r--r--tensorflow/core/kernels/debug_ops_test.cc3
5 files changed, 8 insertions, 5 deletions
diff --git a/tensorflow/compiler/xla/service/cpu/parallel_cpu_executable.cc b/tensorflow/compiler/xla/service/cpu/parallel_cpu_executable.cc
index bef4ecd480..40fa3a67bd 100644
--- a/tensorflow/compiler/xla/service/cpu/parallel_cpu_executable.cc
+++ b/tensorflow/compiler/xla/service/cpu/parallel_cpu_executable.cc
@@ -241,7 +241,7 @@ Status Executor::Run() {
completion_queue_.pop_front();
break;
}
- } while (1);
+ } while (true);
TF_ASSIGN_OR_RETURN(const BufferAllocation::Slice result_slice,
assignment_->GetUniqueTopLevelSlice(instruction));
void* result_buffer =
diff --git a/tensorflow/compiler/xla/service/elemental_ir_emitter.cc b/tensorflow/compiler/xla/service/elemental_ir_emitter.cc
index b02138325e..350dbc321f 100644
--- a/tensorflow/compiler/xla/service/elemental_ir_emitter.cc
+++ b/tensorflow/compiler/xla/service/elemental_ir_emitter.cc
@@ -709,7 +709,7 @@ llvm_ir::ElementGenerator ElementalIrEmitter::MakeRngElementGenerator(
} else {
auto r = ir_builder_->CreateSub(q, p);
auto leading_zeros = llvm_ir::EmitCallToIntrinsic(
- llvm::Intrinsic::ctlz, {r, ir_builder_->getInt1(1)},
+ llvm::Intrinsic::ctlz, {r, ir_builder_->getInt1(true)},
{param_ir_type}, ir_builder_);
auto in_block = ir_builder_->GetInsertBlock();
diff --git a/tensorflow/compiler/xla/service/gpu/elemental_ir_emitter.cc b/tensorflow/compiler/xla/service/gpu/elemental_ir_emitter.cc
index d044462f9a..5edaaba3eb 100644
--- a/tensorflow/compiler/xla/service/gpu/elemental_ir_emitter.cc
+++ b/tensorflow/compiler/xla/service/gpu/elemental_ir_emitter.cc
@@ -334,7 +334,7 @@ llvm_ir::ElementGenerator GpuElementalIrEmitter::MakeElementGenerator(
SetToFirstInsertPoint(loops.GetInnerLoopBodyBasicBlock(), ir_builder_);
IrArray::Index input_index(index.size());
- llvm::Value* in_bounds = ir_builder_->getInt1(1);
+ llvm::Value* in_bounds = ir_builder_->getInt1(true);
for (size_t i = 0; i < index.size(); ++i) {
llvm::Value* stridden_index = ir_builder_->CreateNSWMul(
index[i], ir_builder_->getInt64(window.dimensions(i).stride()));
diff --git a/tensorflow/core/framework/cancellation.cc b/tensorflow/core/framework/cancellation.cc
index 1cbed62939..9da4828bba 100644
--- a/tensorflow/core/framework/cancellation.cc
+++ b/tensorflow/core/framework/cancellation.cc
@@ -23,7 +23,9 @@ namespace tensorflow {
const CancellationToken CancellationManager::kInvalidToken = -1;
CancellationManager::CancellationManager()
- : is_cancelling_(false), is_cancelled_(0), next_cancellation_token_(0) {}
+ : is_cancelling_(false),
+ is_cancelled_(false),
+ next_cancellation_token_(0) {}
void CancellationManager::StartCancel() {
gtl::FlatMap<CancellationToken, CancelCallback> callbacks_to_run;
diff --git a/tensorflow/core/kernels/debug_ops_test.cc b/tensorflow/core/kernels/debug_ops_test.cc
index 89bcbc9c37..37c9486594 100644
--- a/tensorflow/core/kernels/debug_ops_test.cc
+++ b/tensorflow/core/kernels/debug_ops_test.cc
@@ -573,7 +573,8 @@ TEST_F(DebugNumericSummaryOpTest, UInt8Success) {
TEST_F(DebugNumericSummaryOpTest, BoolSuccess) {
TF_ASSERT_OK(Init(DT_BOOL));
- AddInputFromArray<bool>(TensorShape({2, 3}), {0, 0, 1, 1, 1, 0});
+ AddInputFromArray<bool>(TensorShape({2, 3}),
+ {false, false, true, true, true, false});
TF_ASSERT_OK(RunOpKernel());
Tensor expected(allocator(), DT_DOUBLE, TensorShape({16}));