MCPcopy Create free account
hub / github.com/PaddlePaddle/Paddle / getDict

Method getDict

tools/CrossStackProfiler/CspFileReader.py:292–304  ·  view source on GitHub ↗
(self, name, groupId, gpuId, tmpPath="./tmp")

Source from the content-addressed store, hash-verified

290 return self.getDict("dcgm", groupId, gpuId, tmpPath)
291
292 def getDict(self, name, groupId, gpuId, tmpPath="./tmp"):
293 fileName = self.getFileName(name, groupId, gpuId, tmpPath)
294 if not os.path.isfile(fileName):
295 raise OSError(f"[{fileName}] does not existed!")
296
297 data = {}
298 with open(fileName, "r") as rf:
299 try:
300 data = json.load(rf)
301 except Exception:
302 self._logger.error(f"read [{fileName}] error. not a json file!")
303 raise TypeError(f"read [{fileName}] error. not a json file!")
304 return data
305
306 def dumpOpInfoDict(
307 self, data, groupId, gpuId, pretty=False, tmpPath="./tmp"

Callers 2

getOpInfoDictMethod · 0.95
getDcgmInfoDictMethod · 0.95

Calls 4

getFileNameMethod · 0.95
TypeErrorClass · 0.85
loadMethod · 0.45
errorMethod · 0.45

Tested by

no test coverage detected