We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3e80253 commit 04285abCopy full SHA for 04285ab
paddle/fluid/imperative/tracer.cc
@@ -32,6 +32,8 @@ namespace imperative {
32
33
thread_local bool Tracer::has_grad_ = true;
34
35
+thread_local AmpLevel Tracer::amp_level_ = AmpLevel::O0;
36
+
37
static std::shared_ptr<Tracer> g_current_tracer(nullptr);
38
39
const std::shared_ptr<Tracer>& GetCurrentTracer() { return g_current_tracer; }
paddle/fluid/imperative/tracer.h
@@ -126,7 +126,7 @@ class Tracer {
126
platform::Place expected_place_;
127
GarbageCollectorMap gcs_;
128
static thread_local bool has_grad_;
129
- AmpLevel amp_level_{AmpLevel::O0};
+ static thread_local AmpLevel amp_level_;
130
};
131
132
// To access static variable current_tracer
0 commit comments