MCPcopy Index your code
hub / github.com/tensorpack/tensorpack / __enter__

Method __enter__

tensorpack/utils/nvml.py:161–165  ·  view source on GitHub ↗

Create a new context

(self)

Source from the content-addressed store, hash-verified

159
160 """
161 def __enter__(self):
162 """Create a new context """
163 _NVML.load()
164 _check_return(_NVML.get_function("nvmlInit_v2")())
165 return self
166
167 def __exit__(self, type, value, tb):
168 """Destroy current context"""

Callers 1

libinfo.pyFile · 0.45

Calls 3

_check_returnFunction · 0.85
get_functionMethod · 0.80
loadMethod · 0.45

Tested by

no test coverage detected