MCPcopy Create free account
hub / github.com/PeizeSun/SparseR-CNN / to

Method to

projects/SparseRCNN/sparsercnn/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 8

apply_deltasMethod · 0.45
__init__Method · 0.45
forwardMethod · 0.45
prepare_targetsMethod · 0.45
preprocess_imageMethod · 0.45
all_gatherFunction · 0.45

Calls 1

NestedTensorClass · 0.85

Tested by 1