Copy `CSCFormatBase` to the specified device using reflection.
( # pylint: disable=invalid-name
self, device: torch.device, non_blocking=False
)
| 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.""" |
no test coverage detected