Skip to content

Commit

Permalink
Fixed .tensors print for indra ds wrapper. (#2397)
Browse files Browse the repository at this point in the history
  • Loading branch information
khustup committed Jun 1, 2023
1 parent 104b2c7 commit 4057c66
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions deeplake/core/dataset/deeplake_query_tensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,16 @@ def __init__(
deeplake_tensor,
indra_tensor,
is_iteration: bool = False,
key: Optional[str] = None,
):
self.deeplake_tensor = deeplake_tensor
self.indra_tensor = indra_tensor
self.is_iteration = is_iteration

if key:
self.key = key
self.key = (
deeplake_tensor.key
if hasattr(deeplake_tensor, "key")
else indra_tensor.name
)

self.first_dim = None

Expand All @@ -50,15 +52,12 @@ def __getitem__(
if isinstance(item, tuple) or item is Ellipsis:
item = replace_ellipsis_with_slices(item, self.ndim)

key = getattr(self, "key", None)

indra_tensor = self.indra_tensor[item]

return DeepLakeQueryTensor(
self.deeplake_tensor,
indra_tensor,
is_iteration=is_iteration,
key=key,
)

def numpy(
Expand Down

0 comments on commit 4057c66

Please sign in to comment.