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

Method to

python/dgl/graphbolt/base.py:478–497  ·  view source on GitHub ↗

Copy `CSCFormatBase` to the specified device using reflection.

(  # pylint: disable=invalid-name
        self, device: torch.device, non_blocking=False
    )

Source from the content-addressed store, hash-verified

476 return _csc_format_base_str(self)
477
478 def to( # pylint: disable=invalid-name
479 self, device: torch.device, non_blocking=False
480 ) -> None:
481 """Copy `CSCFormatBase` to the specified device using reflection."""
482
483 for attr in dir(self):
484 # Only copy member variables.
485 if not callable(getattr(self, attr)) and not attr.startswith("__"):
486 setattr(
487 self,
488 attr,
489 recursive_apply(
490 getattr(self, attr),
491 apply_to,
492 device,
493 non_blocking=non_blocking,
494 ),
495 )
496
497 return self
498
499 def pin_memory(self):
500 """Copy `SampledSubgraph` to the pinned memory using reflection."""

Callers 15

pin_memoryMethod · 0.95
extract_node_subframesFunction · 0.45
extract_edge_subframesFunction · 0.45
_prefetchFunction · 0.45
__call__Method · 0.45
pad_packed_tensorFunction · 0.45
pack_padded_tensorFunction · 0.45
backwardFunction · 0.45
process_requestMethod · 0.45
_cast_to_minimum_dtypeFunction · 0.45

Calls 1

recursive_applyFunction · 0.70

Tested by

no test coverage detected