logo
clip
repo-copy-icon

copied

Browse Source

flatten the output vector.

Signed-off-by: wxywb <xy.wang@zilliz.com>
main
wxywb 3 years ago
parent
commit
15dee6f07c
  1. 2
      clip.py

2
clip.py

@ -49,7 +49,7 @@ class Clip(NNOperator):
vec = self._inference_from_text(data) vec = self._inference_from_text(data)
else: else:
raise ValueError("modality[{}] not implemented.".format(self._modality)) raise ValueError("modality[{}] not implemented.".format(self._modality))
return vec.detach().cpu().numpy()
return vec.detach().cpu().numpy().flatten()
def _inference_from_text(self, text): def _inference_from_text(self, text):
text = self.tokenize(text).to(self.device) text = self.tokenize(text).to(self.device)

Loading…
Cancel
Save