Skip to content

Commit

Permalink
More updates
Browse files Browse the repository at this point in the history
  • Loading branch information
istranical committed May 15, 2024
1 parent deaa6bd commit 7a975d2
Show file tree
Hide file tree
Showing 4 changed files with 82 additions and 53 deletions.
16 changes: 8 additions & 8 deletions deeplake/core/dataset/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -2568,8 +2568,8 @@ def tensorflow(
def flush(self):
"""
Writes all the data that has been changed/assigned from the cache layers (if any) to the underlying storage.
NOTE: The high-level APIs flush the cache automatically and users generally do not have explicitly run the ``flush`` command.
NOTE: The high-level APIs flush the cache automatically and users generally do not have explicitly run the ``flush`` command.
"""
self._flush_vc_info()
self.storage.flush()
Expand All @@ -2588,7 +2588,7 @@ def clear_cache(self):
This doesn't delete data from the actual storage.
This is useful if you have multiple datasets with memory caches open, taking up too much RAM, or when local cache is no longer needed for certain datasets and is taking up storage space.
NOTE: The high-level APIs clear the cache automatically and users generally do not have explicitly run the ``clear_cache`` command.
NOTE: The high-level APIs clear the cache automatically and users generally do not have explicitly run the ``clear_cache`` command.
"""

if hasattr(self.storage, "clear_cache"):
Expand Down Expand Up @@ -3207,10 +3207,10 @@ def extend(
ignore_errors: bool = False,
progressbar: bool = False,
):
"""Appends multiple rows of samples to mutliple tensors at once. This method expects all tensors being updated to be of the same length.
"""Appends multiple samples (rows) to mutliple tensors at once. This method expects all tensors being updated to be of the same length.
Args:
samples (Dict[str, Any]): Dictionary with tensor names as keys and samples as values.
samples (Dict[str, Any]): Dictionary with tensor names as keys and data as values. The values can be a sequence (i.e. a list) or a single numpy array (the first axis in the array is treated as the row axis).
skip_ok (bool): Skip tensors not in ``samples`` if set to True.
append_empty (bool): Append empty samples to tensors not specified in ``sample`` if set to ``True``. If True, ``skip_ok`` is ignored.
ignore_errors (bool): Skip samples that cause errors while extending, if set to ``True``.
Expand Down Expand Up @@ -3297,7 +3297,7 @@ def append(
skip_ok: bool = False,
append_empty: bool = False,
):
"""Append samples to multiple tensors at once.
"""Append a single sample (row) to multiple tensors at once.
Args:
sample (dict): Dictionary with tensor names as keys and samples as values.
Expand All @@ -3315,11 +3315,11 @@ def append(
Examples:
>>> ds = deeplake.empty("../test/test_ds")
>>>
>>> with ds:
>>> ds.create_tensor('data')
>>> ds.create_tensor('labels')
>>>
>>> # This operation will append 1 sample (row) to the Deep Lake dataset
>>> ds.append({"data": 1, "labels": "table"})
Expand Down
6 changes: 2 additions & 4 deletions deeplake/core/tensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,8 +326,7 @@ def extend(
progressbar: bool = False,
ignore_errors: bool = False,
):
"""Extends the end of the tensor by appending multiple elements from a sequence. Accepts a sequence, a single batched numpy array,
or a sequence of :func:`deeplake.read` outputs, which can be used to load files. See examples down below.
"""Extends the end of the tensor by appending multiple elements from a sequence. Accepts a sequence (i.e. a list) or a single numpy array (the first axis in the array is treated as the row axis).
Example:
Numpy input:
Expand Down Expand Up @@ -429,8 +428,7 @@ def _append(self, sample: InputSample):

@invalid_view_op
def append(self, sample: InputSample):
"""Appends a single sample to the end of the tensor. Can be an array, scalar value, or the return value from :func:`deeplake.read`,
which can be used to load files. See examples down below.
"""Appends a single sample (row) to the end of the tensor.
Examples:
Numpy input:
Expand Down
Loading

0 comments on commit 7a975d2

Please sign in to comment.