MCPcopy Index your code
hub / github.com/twitter/the-algorithm-ml / to

Method to

common/batch.py:19–23  ·  view source on GitHub ↗
(self, device: torch.device, non_blocking: bool = False)

Source from the content-addressed store, hash-verified

17 raise NotImplementedError
18
19 def to(self, device: torch.device, non_blocking: bool = False):
20 args = {}
21 for feature_name, feature_value in self.as_dict().items():
22 args[feature_name] = feature_value.to(device=device, non_blocking=non_blocking)
23 return self.__class__(**args)
24
25 def record_stream(self, stream: torch.cuda.streams.Stream) -> None:
26 for feature_value in self.as_dict().values():

Callers 6

test_sparse_pipelineFunction · 0.80
test_ampFunction · 0.80
_to_deviceFunction · 0.80
create_metricsFunction · 0.80
forwardMethod · 0.80
log_ebc_normsFunction · 0.80

Calls 1

as_dictMethod · 0.95

Tested by 2

test_sparse_pipelineFunction · 0.64
test_ampFunction · 0.64