示例#1
0
 def config(self):
     return ProfilerConfig(
         self.profiler_kind,
         self.record_shapes,
         self.profile_memory,
         self.with_stack,
         self.with_flops,
         self.with_modules,
         self.experimental_config)
示例#2
0
 def config(self):
     return ProfilerConfig(
         self.profiler_kind,
         self.record_shapes,
         self.profile_memory,
         self.with_stack,
         self.with_flops,
         self.with_modules,
         # avoid exposing _ExperimentalConfig this in legacy public API
         torch._C._autograd._ExperimentalConfig(),
     )
示例#3
0
 def __enter__(self):
     if not self.enabled:
         return
     if self.entered:
         raise RuntimeError(
             "ITT annotation context manager is not reentrant")
     self.entered = True
     _enable_profiler(
         ProfilerConfig(ProfilerState.ITT, self.record_shapes, False, False,
                        False, False, _ExperimentalConfig()), set())
     return self
示例#4
0
 def __enter__(self):
     if not self.enabled:
         return
     if self.entered:
         raise RuntimeError(
             "NVTX annotation context manager is not reentrant")
     self.entered = True
     torch.cuda.synchronize()
     _enable_profiler(
         ProfilerConfig(ProfilerState.NVTX, self.record_shapes, False,
                        False, False, False), set())
     return self
示例#5
0
 def config(self):
     return ProfilerConfig(self.profiler_kind, self.record_shapes,
                           self.profile_memory, self.with_stack,
                           self.with_flops)