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)
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(), )
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
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
def config(self): return ProfilerConfig(self.profiler_kind, self.record_shapes, self.profile_memory, self.with_stack, self.with_flops)