MCPcopy
hub / github.com/THUDM/CogDL / to

Method to

cogdl/data/data.py:123–128  ·  view source on GitHub ↗

r"""Performs tensor dtype and/or device conversion to all attributes :obj:`*keys`. If :obj:`*keys` is not given, the conversion is applied to all present attributes.

(self, device, *keys)

Source from the content-addressed store, hash-verified

121 return self.apply(lambda x: x.contiguous(), *keys)
122
123 def to(self, device, *keys):
124 r"""Performs tensor dtype and/or device conversion to all attributes
125 :obj:`*keys`.
126 If :obj:`*keys` is not given, the conversion is applied to all present
127 attributes."""
128 return self.apply(lambda x: x.to(device), *keys)
129
130 def cuda(self, *keys):
131 return self.apply(lambda x: x.cuda(), *keys)

Callers 15

batch_sum_poolingFunction · 0.45
batch_sum_poolingFunction · 0.45
_initMethod · 0.45
trainMethod · 0.45
infer_embeddingsMethod · 0.45
evaluateMethod · 0.45
_feature_maskingMethod · 0.45
process_npzFunction · 0.45
mainFunction · 0.45
_preprocessingMethod · 0.45
preprocessingMethod · 0.45
mini_forwardMethod · 0.45

Calls 1

applyMethod · 0.95

Tested by 4

train_modelFunction · 0.36
init_datasetFunction · 0.36
test_adversarial_trainFunction · 0.36
test_stepMethod · 0.36