MCPcopy
hub / github.com/dmlc/dgl / _record_stream

Function _record_stream

python/dgl/dataloading/dataloader.py:473–484  ·  view source on GitHub ↗
(x, stream)

Source from the content-addressed store, hash-verified

471
472
473def _record_stream(x, stream):
474 if stream is None:
475 return x
476 if hasattr(x, "record_stream"):
477 x.record_stream(stream)
478 return x
479 elif isinstance(x, _PrefetchedGraphFeatures):
480 node_feats = recursive_apply(x.node_feats, _record_stream, stream)
481 edge_feats = recursive_apply(x.edge_feats, _record_stream, stream)
482 return _PrefetchedGraphFeatures(node_feats, edge_feats)
483 else:
484 return x
485
486
487def _prefetch(batch, dataloader, stream):

Callers

nothing calls this directly

Calls 3

recursive_applyFunction · 0.50
record_streamMethod · 0.45

Tested by

no test coverage detected