mirror of
https://github.com/ml-explore/mlx.git
synced 2025-12-14 17:12:49 +08:00
Remove duplicate private section of thread_pool()
This commit is contained in:
@@ -99,11 +99,9 @@ class ParallelFileReader : public Reader {
|
||||
return "file " + label_;
|
||||
}
|
||||
|
||||
private:
|
||||
static ThreadPool& thread_pool();
|
||||
|
||||
private:
|
||||
static constexpr size_t batch_size_ = 1 << 25;
|
||||
static ThreadPool& thread_pool();
|
||||
int fd_;
|
||||
std::string label_;
|
||||
};
|
||||
|
||||
@@ -42,8 +42,8 @@ class Synchronizer : public Primitive {
|
||||
// are currently under a function transformation and the retain_graph()
|
||||
// function which returns true if we are forced to retain the graph during
|
||||
// evaluation.
|
||||
std::vector<char>& detail::InTracing::trace_stack() {
|
||||
static std::vector<char> trace_stack_;
|
||||
std::vector<std::pair<char, char>>& detail::InTracing::trace_stack() {
|
||||
static std::vector<std::pair<char, char>> trace_stack_;
|
||||
return trace_stack_;
|
||||
}
|
||||
int detail::InTracing::grad_counter{0};
|
||||
|
||||
@@ -26,7 +26,7 @@ struct InTracing {
|
||||
}
|
||||
~InTracing() {
|
||||
grad_counter -= trace_stack().back().second;
|
||||
trace_stack.pop_back();
|
||||
trace_stack().pop_back();
|
||||
}
|
||||
|
||||
static bool in_tracing() {
|
||||
@@ -43,7 +43,7 @@ struct InTracing {
|
||||
|
||||
private:
|
||||
static int grad_counter;
|
||||
static std::vector<char>& trace_stack();
|
||||
static std::vector<std::pair<char, char>>& trace_stack();
|
||||
};
|
||||
|
||||
struct RetainGraph {
|
||||
|
||||
Reference in New Issue
Block a user