MCPcopy Create free account
hub / github.com/WeChatCV/WeVisionOne / to

Method to

WeVisionOne/utils/misc.py:31–40  ·  view source on GitHub ↗
(self, device)

Source from the content-addressed store, hash-verified

29 self.mask = mask
30
31 def to(self, device):
32 # type: (Device) -> NestedTensor # noqa
33 cast_tensor = self.tensors.to(device)
34 mask = self.mask
35 if mask is not None:
36 assert mask is not None
37 cast_mask = mask.to(device)
38 else:
39 cast_mask = None
40 return NestedTensor(cast_tensor, cast_mask)
41
42 def decompose(self):
43 return self.tensors, self.mask

Callers 14

forwardMethod · 0.80
__init__Method · 0.80
predictMethod · 0.80
predict_with_argsMethod · 0.80
pred_boxMethod · 0.80
forwardMethod · 0.80
pred_boxMethod · 0.80
pfuncMethod · 0.80
forwardMethod · 0.80
get_rel_posFunction · 0.80
forwardMethod · 0.80

Calls 1

NestedTensorClass · 0.85

Tested by

no test coverage detected