Skip to content

Commit

Permalink
Merge pull request #2815 from activeloopai/docs_tweaks_2
Browse files Browse the repository at this point in the history
docs tweaks
  • Loading branch information
istranical committed Apr 2, 2024
2 parents 50c6d49 + 4def757 commit ec84842
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
20 changes: 18 additions & 2 deletions deeplake/core/dataset/dataset.py
Expand Up @@ -2278,10 +2278,26 @@ def filter(
Example:
Following filters are identical and return dataset view where all the samples have label equals to 2.
Return dataset view where all the samples have label equals to 2:
>>> dataset.filter(lambda sample: sample.labels.numpy() == 2)
>>> dataset.filter('labels == 2')
Append one dataset onto another (only works if their structure is identical):
>>> @deeplake.compute
>>> def dataset_append(sample_in, sample_out):
>>>
>>> sample_out.append(sample_in.tensors)
>>>
>>> return sample_out
>>>
>>>
>>> dataset_append().eval(
>>> ds_in,
>>> ds_out,
>>> num_workers = 2
>>> )
"""
from deeplake.core.query import filter_dataset, query_dataset

Expand Down
4 changes: 1 addition & 3 deletions docs/source/Htypes.rst
Expand Up @@ -10,12 +10,10 @@ Htypes

Htype is the class of a tensor: image, bounding box, generic tensor, etc.

The htype of a tensor can be specified at its creation
It is highly recommended to specify the htype during tensor creation. For numeric tensors, if htype is not specified, it defaults to "generic".

>>> ds.create_tensor("my_tensor", htype="...")

If not specified, the tensor's htype defaults to "generic".

Specifying an htype allows for strict settings and error handling, and it is critical for increasing the performance of Deep Lake datasets containing rich data such as images and videos.

Supported htypes and their respective defaults are:
Expand Down

0 comments on commit ec84842

Please sign in to comment.