Skip to content

feat: universal tensor type#843

Merged
samsja merged 4 commits into
feat-rewrite-v2from
feat-universal-tensor
Nov 24, 2022
Merged

feat: universal tensor type#843
samsja merged 4 commits into
feat-rewrite-v2from
feat-universal-tensor

Conversation

@JohannesMessner

@JohannesMessner JohannesMessner commented Nov 24, 2022

Copy link
Copy Markdown
Member

Introduces the type Tensor can take any kind of tensor (for now this means np and torch).
The former tensor type is renamed to NdArray.

As far as the proto is concerned, Tensor does not exist; it is only a shorthand that will cast the input either to NdArray or to TorchTensor.

closes #782

Signed-off-by: Johannes Messner <messnerjo@gmail.com>
Signed-off-by: Johannes Messner <messnerjo@gmail.com>
Signed-off-by: Johannes Messner <messnerjo@gmail.com>
Comment thread docarray/predefined_document/image.py Outdated
Comment thread tests/integrations/array/test_array_proto.py
Comment thread tests/integrations/document/test_to_json.py
Comment thread tests/integrations/externals/test_fastapi.py
Comment thread tests/integrations/typing/test_typing_proto.py
Comment thread tests/units/array/test_mixins/test_attribute.py
Comment thread tests/units/array/test_mixins/test_attribute.py
Comment thread tests/units/document/proto/test_document_proto.py
Comment thread tests/units/document/proto/test_proto_based_object.py
Comment thread tests/units/document/test_any_document.py
Comment thread README.md
Signed-off-by: Johannes Messner <messnerjo@gmail.com>
@JohannesMessner

Copy link
Copy Markdown
Member Author

I kept the type as NdArray in the tests since the tests are not about that.
To properly test the (de)serialization of this new type I instead added a dedicated test for that

@samsja samsja merged commit d56bbb8 into feat-rewrite-v2 Nov 24, 2022
@samsja samsja deleted the feat-universal-tensor branch November 24, 2022 14:59
@JohannesMessner JohannesMessner linked an issue Nov 24, 2022 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Type: Catch-all tensor

2 participants