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
This commit is contained in:
Edward Yang 2018-12-05 21:14:03 -08:00 committed by Facebook Github Bot
parent f9446e0c94
commit a6399121da
5 changed files with 5 additions and 5 deletions

View File

@ -21,7 +21,7 @@ class MaxMinOpBase : public Operator<Context> {
auto* output = Output(0); auto* output = Output(0);
output->ResizeLike(input0); output->ResizeLike(input0);
output->CopyFrom(input0, &context_); output->CopyFrom(input0, /* async */ true);
if (InputSize() == 1) { if (InputSize() == 1) {
return true; return true;

View File

@ -18,7 +18,7 @@ class NegateGradientOp final : public Operator<Context> {
const auto& in = Input(0); const auto& in = Input(0);
auto* out = Output(0); auto* out = Output(0);
if (out != &in) { if (out != &in) {
out->CopyFrom(in, &context_); out->CopyFrom(in, /* async */ true);
} }
return true; return true;
} }

View File

@ -81,7 +81,7 @@ class ReservoirSamplingOp final : public Operator<Context> {
if (num_entries == 0) { if (num_entries == 0) {
if (!output_initialized) { if (!output_initialized) {
// Get both shape and meta // Get both shape and meta
output->CopyFrom(input, &context_); output->CopyFrom(input, /* async */ true);
} }
return true; return true;
} }

View File

@ -102,7 +102,7 @@ bool TensorProtosDBInput<Context>::CopyPrefetched() {
for (int i = 0; i < OutputSize(); ++i) { for (int i = 0; i < OutputSize(); ++i) {
OperatorBase::template Output<Tensor>(i, Context::GetDeviceType()) OperatorBase::template Output<Tensor>(i, Context::GetDeviceType())
->CopyFrom( ->CopyFrom(
prefetched_blobs_[i].template Get<TensorCPU>(), &this->context_); prefetched_blobs_[i].template Get<TensorCPU>(), /* async */ true);
} }
return true; return true;
} }

View File

@ -51,7 +51,7 @@ class ClipTensorByScalingOp final : public Operator<Context> {
&context_); &context_);
} else { } else {
if (input_tensor_data != clipped_tensor_data) { if (input_tensor_data != clipped_tensor_data) {
clipped->CopyFrom(input_tensor, &context_); clipped->CopyFrom(input_tensor, /*async*/ true);
} }
} }