FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

feat(v2): add tensorflow support by anna-charlotte · Pull Request #1064 · docarray/docarray · GitHub

This repository was archived by the owner on Sep 9, 2026. It is now read-only.
/ docarray Public archive
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
ba1a4b6
feat: add tensorflow tensor
Jan 30, 2023
978dfe4
feat: wip add tf comp backend
Jan 30, 2023
712c950
fix: comp backend working of TensorFlowTensor, not tf tensor
Jan 30, 2023
fd88185
test: remove redundant print statements
Jan 30, 2023
17fe3d5
feat: add comp backend retrieval
Jan 31, 2023
b0fd980
fix: extract methods that overlap for np and tf backend
Jan 31, 2023
c2e6ab0
fix: revert poetry lock change
Jan 31, 2023
cf6a0ef
fix: introduce norm callables to transform tftensor
Jan 31, 2023
194ab9f
docs: clean up
Jan 31, 2023
6a2ecf1
fix: retrieval and add docstring
Jan 31, 2023
056db70
fix: add cosine sim for tf backend matrics
Feb 1, 2023
6c35902
fix: euclidean dist
Feb 1, 2023
2abe113
fix: add typevar to register proto
Feb 1, 2023
beb340e
fix: clean up
Feb 1, 2023
1817c44
fix: add tft to inits
Feb 2, 2023
a74daac
test: add tests for tensorflow tensor
Feb 2, 2023
ab7d153
fix: mypy checks
Feb 2, 2023
72744ad
fix: docarray from native
Feb 2, 2023
dfdff10
docs: add documentatino and clean up
Feb 2, 2023
28a7291
fix: clean up
Feb 2, 2023
418ee37
fix: clean up
Feb 2, 2023
217c870
fix: stacked array with tf tensor
Feb 3, 2023
fd7a8e5
fix: stack with tftensor
Feb 3, 2023
26150b6
test: fix get item test
Feb 3, 2023
567b56a
fix: access by slice for tftensor
Feb 3, 2023
665f408
fix: add proto for tf
Feb 6, 2023
68bdd77
test: introduce pytest tensorflow marker
Feb 6, 2023
fcd5b74
fix: typo in ci.yml
Feb 6, 2023
1e8e240
fix: try tf import
Feb 6, 2023
a5988ab
fix: mypy
Feb 6, 2023
156a508
fix: ndarray import
Feb 6, 2023
a29f5c1
fix: tf import
Feb 6, 2023
eb6a53a
test: add tf markers
Feb 6, 2023
a2afa41
test: fix unit tests
Feb 6, 2023
9cc04dd
test: fix unit tests
Feb 6, 2023
bfffc2d
fix: tf in array stacked
Feb 6, 2023
6e715b3
test: tf
Feb 6, 2023
cc2e837
chore: pytest proto marker call with -m
Feb 6, 2023
125f66c
fix: instance check use instance shape
Feb 6, 2023
d6506d1
fix: tf tests
Feb 6, 2023
73f8b0a
fix: test
Feb 6, 2023
2d9162c
fix: add print statement to debug
Feb 6, 2023
ef335ad
fix: tf test
Feb 6, 2023
1e85f7a
test: only tf
Feb 6, 2023
ca8d1d1
test: remove tests for debugging
Feb 6, 2023
1dd9c6e
test: add all tests back to ci yml
Feb 6, 2023
f8d8426
test: fix import
Feb 6, 2023
269cf0f
test: ci debugging
Feb 6, 2023
9bcb816
test: change pytest marker for tf
Feb 6, 2023
dac79e2
test: change python version back
Feb 6, 2023
8046e99
test: revert
Feb 6, 2023
e325244
test: debugging
Feb 6, 2023
b7db1c8
fix: test
Feb 6, 2023
9d1ef56
fix: tests
Feb 6, 2023
0467aca
test: ignore paths
Feb 6, 2023
a25dceb
fix: tests
Feb 6, 2023
52064d2
fix: tests
Feb 6, 2023
591cea1
refactor: rename norm left and norm right
Feb 7, 2023
5fc2721
docs: tft docstring
Feb 7, 2023
7432123
docs: add comment to array stacked tf
Feb 7, 2023
1144d6f
fix: apply suggestion from code review
Feb 7, 2023
25b9f42
fix: apply suggestions from code review
Feb 7, 2023
20a2b3e
fix: merge
Feb 7, 2023
102e42a
test: fix black formatting
Feb 7, 2023
b4b7e43
fix: implement getitem setitem iter for tftensor
Feb 7, 2023
545438d
docs: readme
Feb 7, 2023
4905526
Merge remote-tracking branch 'origin/feat-rewrite-v2' into feat-tenso…
Feb 8, 2023
c2aa0b1
docs: update readme.md
Feb 8, 2023
81a2540
fix: remove n dim from abstract method instead use comp be
Feb 8, 2023
838955a
fix: remove proto mark, because only test for proto 3 here
Feb 8, 2023
09dd6a9
fix: tf set item and add tests
Feb 8, 2023
5daa511
Merge branch 'feat-rewrite-v2' into feat-tensorflow-support
Feb 8, 2023
6c36d25
Merge branch 'feat-rewrite-v2' into feat-tensorflow-support
Feb 8, 2023
85183ec
docs: update tf section in readme.md
Feb 8, 2023
File filter

Filter by extension

Filter by extension .py  (2) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
Prev Previous commit
Next Next commit
fix: tf set item and add tests
Signed-off-by: anna-charlotte <charlotte.gerhaher@jina.ai>
  • Loading branch information
anna-charlotte committed Feb 8, 2023
commit 09dd6a9deeffbcddb3b744021437b9af040e2d3e
13 changes: 5 additions & 8 deletions docarray/typing/tensor/tensorflow_tensor.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import numpy as np
import tensorflow as tf # type: ignore
import tensorflow._api.v2.experimental.numpy as tnp # type: ignore

from docarray.typing.proto_register import _register_proto
from docarray.typing.tensor.abstract_tensor import AbstractTensor
Expand Down Expand Up @@ -145,13 +144,11 @@ def __getitem__(self, item):

def __setitem__(self, index, value):
"""Set a slice of this tensor's tf.Tensor"""
if tnp.all(tf.math.is_nan(value)):
self.tensor = None
else:
t = self.unwrap()
var = tf.Variable(t)
var[index].assign(value)
self.tensor = tf.constant(var)
t = self.unwrap()
value = tf.cast(value, dtype=t.dtype)
var = tf.Variable(t)
var[index].assign(value)
self.tensor = tf.constant(var)

def __iter__(self):
"""Iterate over the elements of this tensor's tf.Tensor."""
Expand Down
1 change: 0 additions & 1 deletion tests/units/array/test_array_stacked_tf.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,6 @@ class MyDoc(BaseDocument):
).stack()

assert 'tensor' in da._tensor_columns.keys()
assert da.tensor.tensor is None


@pytest.mark.tensorflow
Expand Down

Back | FazBrowse Home | New Git URL