コード例 #1
0
ファイル: profiler.py プロジェクト: yuguo68/pytorch
 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
ファイル: profiler.py プロジェクト: timgates42/pytorch
 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)