MCPcopy Create free account
hub / github.com/OpenDriveLab/ReSim / to

Method to

SwissArmyTransformer/examples/yolos/util/misc.py:288–297  ·  view source on GitHub ↗
(self, device)

Source from the content-addressed store, hash-verified

286 self.mask = mask
287
288 def to(self, device):
289 # type: (Device) -> NestedTensor # noqa
290 cast_tensor = self.tensors.to(device)
291 mask = self.mask
292 if mask is not None:
293 assert mask is not None
294 cast_mask = mask.to(device)
295 else:
296 cast_mask = None
297 return NestedTensor(cast_tensor, cast_mask)
298
299 def decompose(self):
300 return self.tensors, self.mask

Callers 15

test_bert_inferenceFunction · 0.80
forwardMethod · 0.80
transform_param.pyFile · 0.80
chatFunction · 0.80
chatFunction · 0.80
get_batchFunction · 0.80
inference_clip.pyFile · 0.80
transform_param.pyFile · 0.80

Calls 1

NestedTensorClass · 0.85

Tested by 3

test_bert_inferenceFunction · 0.64
forwardMethod · 0.64
test_decodeFunction · 0.64