summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Yang <ezyang@fb.com>2018-12-05 21:14:03 -0800
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>2018-12-05 21:18:31 -0800
commita6399121da167606bd2c7390bcc9fffdaad43b5c (patch)
tree678afaf92a55460a6607b3867f0880b0ba723c79
parentf9446e0c944e0d430b5be89e7968c23a8f5212e7 (diff)
downloadpytorch-a6399121da167606bd2c7390bcc9fffdaad43b5c.tar.gz
pytorch-a6399121da167606bd2c7390bcc9fffdaad43b5c.tar.bz2
pytorch-a6399121da167606bd2c7390bcc9fffdaad43b5c.zip
Shut up "address will always evaluate to 'true'" warnings (#14774)
Summary: Signed-off-by: Edward Z. Yang <ezyang@fb.com> Pull Request resolved: https://github.com/pytorch/pytorch/pull/14774 Differential Revision: D13327969 Pulled By: ezyang fbshipit-source-id: 43380c89eedaaa89467952401b8fd3f5a9ad754a
-rw-r--r--caffe2/operators/minmax_ops.h2
-rw-r--r--caffe2/operators/negate_gradient_op.h2
-rw-r--r--caffe2/operators/reservoir_sampling.cc2
-rw-r--r--caffe2/operators/tensor_protos_db_input.h2
-rw-r--r--caffe2/sgd/clip_tensor_op.h2
5 files changed, 5 insertions, 5 deletions
diff --git a/caffe2/operators/minmax_ops.h b/caffe2/operators/minmax_ops.h
index 0190aaf6b5..db02e0dcb0 100644
--- a/caffe2/operators/minmax_ops.h
+++ b/caffe2/operators/minmax_ops.h
@@ -21,7 +21,7 @@ class MaxMinOpBase : public Operator<Context> {
auto* output = Output(0);
output->ResizeLike(input0);
- output->CopyFrom(input0, &context_);
+ output->CopyFrom(input0, /* async */ true);
if (InputSize() == 1) {
return true;
diff --git a/caffe2/operators/negate_gradient_op.h b/caffe2/operators/negate_gradient_op.h
index 8818ec3502..f6f1bb2485 100644
--- a/caffe2/operators/negate_gradient_op.h
+++ b/caffe2/operators/negate_gradient_op.h
@@ -18,7 +18,7 @@ class NegateGradientOp final : public Operator<Context> {
const auto& in = Input(0);
auto* out = Output(0);
if (out != &in) {
- out->CopyFrom(in, &context_);
+ out->CopyFrom(in, /* async */ true);
}
return true;
}
diff --git a/caffe2/operators/reservoir_sampling.cc b/caffe2/operators/reservoir_sampling.cc
index 285dbbaca9..df20c7fe2a 100644
--- a/caffe2/operators/reservoir_sampling.cc
+++ b/caffe2/operators/reservoir_sampling.cc
@@ -81,7 +81,7 @@ class ReservoirSamplingOp final : public Operator<Context> {
if (num_entries == 0) {
if (!output_initialized) {
// Get both shape and meta
- output->CopyFrom(input, &context_);
+ output->CopyFrom(input, /* async */ true);
}
return true;
}
diff --git a/caffe2/operators/tensor_protos_db_input.h b/caffe2/operators/tensor_protos_db_input.h
index fe20d3dd8d..8ba2ff52e3 100644
--- a/caffe2/operators/tensor_protos_db_input.h
+++ b/caffe2/operators/tensor_protos_db_input.h
@@ -102,7 +102,7 @@ bool TensorProtosDBInput<Context>::CopyPrefetched() {
for (int i = 0; i < OutputSize(); ++i) {
OperatorBase::template Output<Tensor>(i, Context::GetDeviceType())
->CopyFrom(
- prefetched_blobs_[i].template Get<TensorCPU>(), &this->context_);
+ prefetched_blobs_[i].template Get<TensorCPU>(), /* async */ true);
}
return true;
}
diff --git a/caffe2/sgd/clip_tensor_op.h b/caffe2/sgd/clip_tensor_op.h
index d31dfb2c54..5792051eb3 100644
--- a/caffe2/sgd/clip_tensor_op.h
+++ b/caffe2/sgd/clip_tensor_op.h
@@ -51,7 +51,7 @@ class ClipTensorByScalingOp final : public Operator<Context> {
&context_);
} else {
if (input_tensor_data != clipped_tensor_data) {
- clipped->CopyFrom(input_tensor, &context_);
+ clipped->CopyFrom(input_tensor, /*async*/ true);
}
}