Method
multi_gpu_encode
(self, query_list: Union[List[str], str], batch_size=64, is_query=True)
Source from the content-addressed store, hash-verified
| 201 | |
| 202 | @torch.inference_mode() |
| 203 | def multi_gpu_encode(self, query_list: Union[List[str], str], batch_size=64, is_query=True) -> np.ndarray: |
| 204 | if self.gpu_num > 1: |
| 205 | self.model = torch.nn.DataParallel(self.model) |
| 206 | query_emb = self.encode(query_list, batch_size, is_query) |
| 207 | return query_emb |
| 208 | |
| 209 | @torch.inference_mode() |
| 210 | def encode_image(self, image_list: List) -> np.ndarray: |
Callers
nothing calls this directly
Tested by
no test coverage detected