Skip to content

Commit 2c60ffb

Browse files
asimshankartensorflower-gardener
authored andcommitted
Address a bunch of compiler warnings on the Mac.
For example: - Unused variables/functions/typedefs - Thread-safety annotations Change: 133986225
1 parent ff40bc4 commit 2c60ffb

10 files changed

Lines changed: 8 additions & 36 deletions

File tree

tensorflow/contrib/linear_optimizer/kernels/sdca_ops_test.cc

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,6 @@ Node* Ones(Graph* const g, const int n) {
7777
return test::graph::Constant(g, data);
7878
}
7979

80-
Node* StringIota(Graph* const g, const int n) {
81-
Tensor data(DT_STRING, TensorShape({n}));
82-
test::FillFn<string>(
83-
&data, [](const int i) { return strings::StrCat(strings::Hex(i)); });
84-
return test::graph::Constant(g, data);
85-
}
86-
8780
Node* SparseExampleIndices(Graph* const g, const int sparse_features_per_group,
8881
const int num_examples) {
8982
const int x_size = num_examples * 4;

tensorflow/core/common_runtime/kernel_benchmark_testlib.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ class Benchmark {
5454

5555
private:
5656
thread::ThreadPool* pool_ = nullptr;
57-
thread::ThreadPool* non_blocking_pool_ = nullptr;
5857
Device* device_ = nullptr;
5958
Rendezvous* rendez_ = nullptr;
6059
Executor* exec_ = nullptr;

tensorflow/core/distributed_runtime/base_rendezvous_mgr.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,6 @@ BaseRemoteRendezvous::BaseRemoteRendezvous(const WorkerEnv* env, int64 step_id,
130130
bool tolerate_dup_recv)
131131
: env_(env),
132132
step_id_(step_id),
133-
tolerate_dup_recv_(tolerate_dup_recv),
134133
local_(NewLocalRendezvous(tolerate_dup_recv)) {}
135134

136135
BaseRemoteRendezvous::~BaseRemoteRendezvous() {

tensorflow/core/distributed_runtime/base_rendezvous_mgr.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,6 @@ class BaseRemoteRendezvous : public Rendezvous {
162162
const int64 step_id_;
163163

164164
private:
165-
const bool tolerate_dup_recv_;
166165
Rendezvous* local_; // Owns a Ref on this object.
167166

168167
mutable mutex mu_;

tensorflow/core/distributed_runtime/rpc/grpc_remote_worker.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,6 @@ class GrpcRemoteWorker : public WorkerInterface {
250250

251251
// Support for logging.
252252
WorkerCacheLogger* logger_;
253-
bool retry_unavailable_;
254253

255254
TF_DISALLOW_COPY_AND_ASSIGN(GrpcRemoteWorker);
256255
};

tensorflow/core/distributed_runtime/rpc/grpc_worker_service.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class ServerBuilder;
2323
namespace tensorflow {
2424

2525
class AsyncServiceInterface;
26-
class WorkerEnv;
26+
struct WorkerEnv;
2727

2828
// Returns an implementation of WorkerService rpc service.
2929
AsyncServiceInterface* NewGrpcWorkerService(WorkerEnv* env,

tensorflow/core/kernels/cwise_ops_common.cc

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -45,20 +45,6 @@ void BinaryOpShared::SetComputeError(OpKernelContext* ctx) {
4545
}
4646
}
4747

48-
static BCast::Vec FromShape(const TensorShape& shape) {
49-
const int N = shape.dims();
50-
BCast::Vec ret(N);
51-
for (int i = 0; i < N; ++i) {
52-
ret[i] = shape.dim_size(i);
53-
}
54-
return ret;
55-
}
56-
57-
static TensorShape ToShape(const BCast::Vec& vec) {
58-
TensorShape shape(vec);
59-
return shape;
60-
}
61-
6248
BinaryOpShared::BinaryOpState::BinaryOpState(OpKernelContext* ctx)
6349
: in0(ctx->input(0)),
6450
in1(ctx->input(1)),

tensorflow/core/kernels/debug_ops.h

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,21 +38,20 @@ class CopyOp : public OpKernel {
3838
void Compute(OpKernelContext* context) override {
3939
const Tensor& src_tensor = context->input(0);
4040

41-
DeviceContext* device_ctxt = context->op_device_context();
42-
Device* device = static_cast<Device*>(context->device());
43-
44-
// Determine if the input tensor is not on CPU (e.g., on GPU).
45-
bool off_host_input = device->device_type() == DEVICE_GPU &&
46-
!context->input_alloc_attr(0).on_host();
47-
4841
if (src_tensor.IsInitialized()) {
4942
// Source tensor is initialized. Make a copy.
5043
Tensor* copied_tensor;
5144
OP_REQUIRES_OK(context, context->allocate_output(0, src_tensor.shape(),
5245
&copied_tensor));
5346

5447
#if GOOGLE_CUDA
48+
Device* device = static_cast<Device*>(context->device());
49+
// Determine if the input tensor is not on CPU (e.g., on GPU).
50+
bool off_host_input = device->device_type() == DEVICE_GPU &&
51+
!context->input_alloc_attr(0).on_host();
52+
5553
if (off_host_input) {
54+
DeviceContext* device_ctxt = context->op_device_context();
5655
// Input is not on host: deep-copy it from GPU to the same GPU.
5756
Notification done_copy;
5857
GPUUtil::CopyGPUTensorToSameGPU(

tensorflow/core/kernels/fractional_avg_pool_op.cc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,8 +235,6 @@ class FractionalAvgPoolGradOp : public OpKernel {
235235
// tensor of double type. And cast it to the corresponding type.
236236
typedef Eigen::Map<const Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic>>
237237
ConstEigenMatrixMap;
238-
typedef Eigen::Map<Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic>>
239-
EigenMatrixMap;
240238
typedef Eigen::Map<Eigen::Matrix<double, Eigen::Dynamic, Eigen::Dynamic>>
241239
EigenDoubleMatrixMap;
242240

tensorflow/core/kernels/tensor_array.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ std::atomic<int64> TensorArray::tensor_array_counter{0};
7979

8080
Status TensorArray::CopyShapesFrom(TensorArray* rhs) {
8181
mutex_lock l(mu_);
82-
mutex_lock l_rhs(*rhs->mu());
82+
mutex_lock l_rhs(rhs->mu_);
8383
TF_RETURN_IF_ERROR(LockedReturnIfClosed());
8484
TF_RETURN_IF_ERROR(rhs->LockedReturnIfClosed());
8585
if (tensors_.size() != rhs->tensors_.size()) {

0 commit comments

Comments
 (0)