MCPcopy
hub / github.com/yangchris11/samurai / to

Method to

lib/utils/misc.py:289–298  ·  view source on GitHub ↗
(self, device)

Source from the content-addressed store, hash-verified

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

Callers 15

build_sam2Function · 0.45
_generate_masksMethod · 0.45
set_imageMethod · 0.45
set_image_batchMethod · 0.45
add_new_points_or_boxMethod · 0.45
add_new_maskMethod · 0.45
_get_image_featureMethod · 0.45
_run_memory_encoderMethod · 0.45

Calls 1

NestedTensorClass · 0.85

Tested by

no test coverage detected