MCPcopy Create free account
hub / github.com/pytorch/pytorch / decode

Method decode

torch/utils/data/datapipes/utils/decoder.py:312–327  ·  view source on GitHub ↗
(self, data)

Source from the content-addressed store, hash-verified

310 return data
311
312 def decode(self, data):
313 result = {}
314 # single data tuple(pathname, data stream)
315 if isinstance(data, tuple):
316 data = [data]
317
318 if data is not None:
319 for k, v in data:
320 # TODO: xinyu, figure out why Nvidia do this?
321 if k[0] == "_":
322 if isinstance(v, bytes):
323 v = v.decode("utf-8")
324 result[k] = v
325 continue
326 result[k] = self.decode1(self.key_fn(k), v)
327 return result
328
329 def __call__(self, data):
330 return self.decode(data)

Callers 15

__call__Method · 0.95
loadMethod · 0.45
_maybe_decode_asciiFunction · 0.45
_loadFunction · 0.45
load_tensorFunction · 0.45
_read_urlFunction · 0.45
_find_cuda_homeFunction · 0.45
_check_cuda_versionFunction · 0.45
check_compiler_is_gccFunction · 0.45
_run_ninja_buildFunction · 0.45

Calls 2

decode1Method · 0.95
isinstanceFunction · 0.85

Tested by 7

_run_test_codeMethod · 0.36
_run_reproMethod · 0.36
_run_full_testMethod · 0.36
get_pytorch_labelsFunction · 0.36
fetch_and_cacheFunction · 0.36