Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 14 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -212,13 +212,21 @@ doc = MyDoc(tensor=torch.zeros(3, 224, 224)) # works
doc = MyDoc(tensor=torch.zeros(224, 224, 3)) # works by reshaping
doc = MyDoc(tensor=torch.zeros(224)) # fails validation


class Image(BaseDocument):
tensor: TorchTensor[3, 'x', 'x']

Image(tensor = torch.zeros(3, 224, 224)) # works
Image(tensor = torch.zeros(3, 64, 128)) # fails validation because second dimension does not match third
Image(tensor = torch.zeros(4, 224 ,224 )) # fails validation because of the first dimension
Image(tensor = torch.zeros(3 ,64)) # fails validation because it does not have enough dimensions


Image(tensor=torch.zeros(3, 224, 224)) # works
Image(
tensor=torch.zeros(3, 64, 128)
) # fails validation because second dimension does not match third
Image(
tensor=torch.zeros(4, 224, 224)
) # fails validation because of the first dimension
Image(
tensor=torch.zeros(3, 64)
) # fails validation because it does not have enough dimensions
```

## Coming from a vector database
Expand Down Expand Up @@ -268,7 +276,7 @@ match = store.find(Image(embedding=np.zeros((128,))), field='text__embedding', t

to try out the alpha you can install it via git:
```shell
pip install "git+https://github.com/docarray/[email protected]#egg=docarray[common,torch,image]"
pip install "git+https://github.com/docarray/[email protected]#egg=docarray[common,torch,image]"
```
or from the latest development branch
```shell
Expand Down
2 changes: 1 addition & 1 deletion docarray/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = '0.1.0'
__version__ = '2023.01.17.alpha'

from docarray.array.array import DocumentArray
from docarray.base_document.document import BaseDocument
Expand Down