(self, device)
| 391 | return res |
| 392 | |
| 393 | def to(self, device): |
| 394 | # type: (Device) -> NestedTensor # noqa |
| 395 | cast_tensor = self.tensors.to(device) |
| 396 | mask = self.mask |
| 397 | if mask is not None: |
| 398 | assert mask is not None |
| 399 | cast_mask = mask.to(device) |
| 400 | else: |
| 401 | cast_mask = None |
| 402 | return NestedTensor(cast_tensor, cast_mask) |
| 403 | |
| 404 | def to_img_list_single(self, tensor, mask): |
| 405 | assert tensor.dim() == 3, 'dim of tensor should be 3 but {}'.format( |
no test coverage detected