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