Custom transforms (#1246)

This commit is contained in:
Angelos Katharopoulos
2024-07-10 18:00:01 -07:00
committed by GitHub
parent a3c287354f
commit 5c1fa64fb0
16 changed files with 734 additions and 39 deletions

View File

@@ -50,4 +50,20 @@ struct InTracing {
static int tracing_counter;
};
struct RetainGraph {
RetainGraph() {
tracing_counter++;
}
~RetainGraph() {
tracing_counter--;
}
static bool retain_graph() {
return tracing_counter > 0;
}
private:
static int tracing_counter;
};
} // namespace mlx::core::detail