Fix a number of warnings when building TF on Mac.
Mostly unused member variables. PiperOrigin-RevId: 231259867
This commit is contained in:
parent
bb89949e2e
commit
18c47113bd
@ -52,10 +52,6 @@ bool IsTensorIdControlling(const TensorId& tensor_id) {
|
|||||||
return tensor_id.index() == Graph::kControlSlot;
|
return tensor_id.index() == Graph::kControlSlot;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IsOutputPortRegular(const MutableGraphView::OutputPort& port) {
|
|
||||||
return port.port_id > Graph::kControlSlot;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool IsOutputPortControlling(const MutableGraphView::OutputPort& port) {
|
bool IsOutputPortControlling(const MutableGraphView::OutputPort& port) {
|
||||||
return port.port_id == Graph::kControlSlot;
|
return port.port_id == Graph::kControlSlot;
|
||||||
}
|
}
|
||||||
|
@ -30,8 +30,7 @@ namespace grappler {
|
|||||||
class DependencyOptimizer : public GraphOptimizer {
|
class DependencyOptimizer : public GraphOptimizer {
|
||||||
public:
|
public:
|
||||||
DependencyOptimizer() {}
|
DependencyOptimizer() {}
|
||||||
explicit DependencyOptimizer(RewriterConfig::Toggle opt_level)
|
explicit DependencyOptimizer(RewriterConfig::Toggle opt_level) {}
|
||||||
: opt_level_(opt_level) {}
|
|
||||||
~DependencyOptimizer() override {}
|
~DependencyOptimizer() override {}
|
||||||
|
|
||||||
string name() const override { return "dependency_optimizer"; };
|
string name() const override { return "dependency_optimizer"; };
|
||||||
@ -73,7 +72,6 @@ class DependencyOptimizer : public GraphOptimizer {
|
|||||||
// single control edge.
|
// single control edge.
|
||||||
void GroupCrossDeviceControlEdges();
|
void GroupCrossDeviceControlEdges();
|
||||||
|
|
||||||
RewriterConfig::Toggle opt_level_;
|
|
||||||
bool fetch_nodes_known_;
|
bool fetch_nodes_known_;
|
||||||
std::unordered_set<string> nodes_to_preserve_;
|
std::unordered_set<string> nodes_to_preserve_;
|
||||||
std::unique_ptr<NodeMap> node_map_;
|
std::unique_ptr<NodeMap> node_map_;
|
||||||
|
@ -38,9 +38,8 @@ string TryFindHostDevice(const gtl::FlatSet<string>& devices,
|
|||||||
// gpu->gpu->gpu may have been better/faster. We should probably fix this.
|
// gpu->gpu->gpu may have been better/faster. We should probably fix this.
|
||||||
class PinToHostOptimizer : public GraphOptimizer {
|
class PinToHostOptimizer : public GraphOptimizer {
|
||||||
public:
|
public:
|
||||||
PinToHostOptimizer() : opt_level_(RewriterConfig::DEFAULT) {}
|
PinToHostOptimizer() {}
|
||||||
explicit PinToHostOptimizer(RewriterConfig::Toggle opt_level)
|
explicit PinToHostOptimizer(RewriterConfig::Toggle opt_level) {}
|
||||||
: opt_level_(opt_level) {}
|
|
||||||
|
|
||||||
~PinToHostOptimizer() override {}
|
~PinToHostOptimizer() override {}
|
||||||
|
|
||||||
@ -51,9 +50,6 @@ class PinToHostOptimizer : public GraphOptimizer {
|
|||||||
|
|
||||||
void Feedback(Cluster* cluster, const GrapplerItem& item,
|
void Feedback(Cluster* cluster, const GrapplerItem& item,
|
||||||
const GraphDef& optimized_graph, double result) override {}
|
const GraphDef& optimized_graph, double result) override {}
|
||||||
|
|
||||||
private:
|
|
||||||
RewriterConfig::Toggle opt_level_;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // end namespace grappler
|
} // end namespace grappler
|
||||||
|
@ -26,7 +26,7 @@ namespace grappler {
|
|||||||
// nodes to decrease the amount of operations needed to perform a computation.
|
// nodes to decrease the amount of operations needed to perform a computation.
|
||||||
class Remapper : public GraphOptimizer {
|
class Remapper : public GraphOptimizer {
|
||||||
public:
|
public:
|
||||||
explicit Remapper(RewriterConfig::Toggle opt_level) : opt_level_(opt_level) {}
|
explicit Remapper(RewriterConfig::Toggle opt_level) {}
|
||||||
|
|
||||||
~Remapper() override {}
|
~Remapper() override {}
|
||||||
|
|
||||||
@ -37,9 +37,6 @@ class Remapper : public GraphOptimizer {
|
|||||||
|
|
||||||
void Feedback(Cluster* cluster, const GrapplerItem& item,
|
void Feedback(Cluster* cluster, const GrapplerItem& item,
|
||||||
const GraphDef& optimized_graph, double result) override;
|
const GraphDef& optimized_graph, double result) override;
|
||||||
|
|
||||||
private:
|
|
||||||
RewriterConfig::Toggle opt_level_;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // end namespace grappler
|
} // end namespace grappler
|
||||||
|
@ -30,9 +30,8 @@ namespace grappler {
|
|||||||
// information.
|
// information.
|
||||||
class ShapeOptimizer : public GraphOptimizer {
|
class ShapeOptimizer : public GraphOptimizer {
|
||||||
public:
|
public:
|
||||||
ShapeOptimizer() : opt_level_(RewriterConfig::ON) {}
|
ShapeOptimizer() {}
|
||||||
explicit ShapeOptimizer(RewriterConfig::Toggle opt_level)
|
explicit ShapeOptimizer(RewriterConfig::Toggle opt_level) {}
|
||||||
: opt_level_(opt_level) {}
|
|
||||||
|
|
||||||
~ShapeOptimizer() override {}
|
~ShapeOptimizer() override {}
|
||||||
|
|
||||||
@ -43,9 +42,6 @@ class ShapeOptimizer : public GraphOptimizer {
|
|||||||
|
|
||||||
void Feedback(Cluster* cluster, const GrapplerItem& item,
|
void Feedback(Cluster* cluster, const GrapplerItem& item,
|
||||||
const GraphDef& optimized_graph, double result) override;
|
const GraphDef& optimized_graph, double result) override;
|
||||||
|
|
||||||
private:
|
|
||||||
RewriterConfig::Toggle opt_level_;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // end namespace grappler
|
} // end namespace grappler
|
||||||
|
@ -86,7 +86,7 @@ class PosixEnv : public Env {
|
|||||||
return new StdThread(thread_options, name, fn);
|
return new StdThread(thread_options, name, fn);
|
||||||
}
|
}
|
||||||
|
|
||||||
int32 GetCurrentThreadId() {
|
int32 GetCurrentThreadId() override {
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
uint64_t tid64;
|
uint64_t tid64;
|
||||||
pthread_threadid_np(nullptr, &tid64);
|
pthread_threadid_np(nullptr, &tid64);
|
||||||
@ -101,7 +101,7 @@ class PosixEnv : public Env {
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
bool GetCurrentThreadName(string* name) {
|
bool GetCurrentThreadName(string* name) override {
|
||||||
#ifdef __ANDROID__
|
#ifdef __ANDROID__
|
||||||
return false;
|
return false;
|
||||||
#else
|
#else
|
||||||
|
@ -272,7 +272,7 @@ Status ValidateStridedSliceOp(
|
|||||||
const std::array<int64, 2> valid_range = {
|
const std::array<int64, 2> valid_range = {
|
||||||
{stride_i > 0 ? 0 : -1, stride_i > 0 ? dim_i : dim_i - 1}};
|
{stride_i > 0 ? 0 : -1, stride_i > 0 ? dim_i : dim_i - 1}};
|
||||||
|
|
||||||
auto canonical = [stride_i, i, dim_i, masks, valid_range](int64 x, int c) {
|
auto canonical = [stride_i, dim_i, masks, valid_range](int64 x, int c) {
|
||||||
if (masks[c]) {
|
if (masks[c]) {
|
||||||
return stride_i > 0 ? valid_range[c] : valid_range[(c + 1) & 1];
|
return stride_i > 0 ? valid_range[c] : valid_range[(c + 1) & 1];
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user