MCPcopy
hub / github.com/KlingAIResearch/LivePortrait / to

Method to

src/utils/dependencies/XPose/util/misc.py:404–413  ·  view source on GitHub ↗
(self, device)

Source from the content-addressed store, hash-verified

402 return res
403
404 def to(self, device):
405 # type: (Device) -> NestedTensor # noqa
406 cast_tensor = self.tensors.to(device)
407 mask = self.mask
408 if mask is not None:
409 assert mask is not None
410 cast_mask = mask.to(device)
411 else:
412 cast_mask = None
413 return NestedTensor(cast_tensor, cast_mask)
414
415 def to_img_list_single(self, tensor, mask):
416 assert tensor.dim() == 3, "dim of tensor should be 3 but {}".format(tensor.dim())

Callers 15

initialize_inputsFunction · 0.80
executeMethod · 0.80
prepare_sourceMethod · 0.80
prepare_videosMethod · 0.80
make_coordinate_gridFunction · 0.80
get_unipose_outputMethod · 0.80

Calls 1

NestedTensorClass · 0.85

Tested by

no test coverage detected