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

Method _function_pointer

tensorpack/utils/nvml.py:71–75  ·  view source on GitHub ↗
(self, name)

Source from the content-addressed store, hash-verified

69 self.func_ptr = {n: self._function_pointer(n) for n in function_pointers}
70
71 def _function_pointer(self, name):
72 try:
73 return getattr(self._nvmlLib, name)
74 except AttributeError:
75 raise NvmlException(NVML_ERROR_FUNCTION_NOT_FOUND)
76
77 def get_function(self, name):
78 if name in self.func_ptr.keys():

Callers 1

loadMethod · 0.95

Calls 1

NvmlExceptionClass · 0.85

Tested by

no test coverage detected