src/transformers/models/deformable_detr/modeling_deformable_detr.py/NestedTensor/to
class NestedTensor:    def to(self, device):
        cast_tensor = self.tensors.to(device)
        mask = self.mask
        if mask is not None:
            cast_mask = mask.to(device)
        else:
            cast_mask = None
        return NestedTensor(cast_tensor, cast_mask)