Skip to content

Commit

Permalink
Fix typos in docs (huggingface#6957)
Browse files Browse the repository at this point in the history
* Fix typo in comparisions

* Fix two consecutive sentences ending in colon

* Split into two sentences
  • Loading branch information
albertvillanova authored Jun 5, 2024
1 parent 336512d commit 6548e0e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
3 changes: 2 additions & 1 deletion docs/source/use_with_jax.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ If your dataset consists of N-dimensional arrays, you will see that by default t
{'data': [Array([1, 2], dtype=int32), Array([3], dtype=int32)]}
```

However this logic often requires slow shape comparisions and data copies, to avoid this you must explicitly use the [`Array`] feature type and specify the shape of your tensors:
However this logic often requires slow shape comparisons and data copies.
To avoid this, you must explicitly use the [`Array`] feature type and specify the shape of your tensors:

```py
>>> from datasets import Dataset, Features, Array2D
Expand Down
3 changes: 2 additions & 1 deletion docs/source/use_with_pytorch.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ If your dataset consists of N-dimensional arrays, you will see that by default t
{'data': [tensor([1, 2]), tensor([3])]}
```

However this logic often requires slow shape comparisions and data copies, to avoid this you must explicitly use the [`Array`] feature type and specify the shape of your tensors:
However this logic often requires slow shape comparisons and data copies.
To avoid this, you must explicitly use the [`Array`] feature type and specify the shape of your tensors:

```py
>>> from datasets import Dataset, Features, Array2D
Expand Down
6 changes: 4 additions & 2 deletions docs/source/use_with_tensorflow.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ array([[1, 2],
## N-dimensional arrays

If your dataset consists of N-dimensional arrays, you will see that by default they are considered as the same tensor if the shape is fixed:
Otherwise, a TensorFlow formatted dataset outputs a `RaggedTensor` instead of a single tensor:

```py
>>> from datasets import Dataset
Expand All @@ -55,6 +54,8 @@ Otherwise, a TensorFlow formatted dataset outputs a `RaggedTensor` instead of a
[3, 4]])>}
```

Otherwise, a TensorFlow formatted dataset outputs a `RaggedTensor` instead of a single tensor:

```py
>>> from datasets import Dataset
>>> data = [[[1, 2],[3]],[[4, 5, 6],[7, 8]]] # varying shape
Expand All @@ -64,7 +65,8 @@ Otherwise, a TensorFlow formatted dataset outputs a `RaggedTensor` instead of a
{'data': <tf.RaggedTensor [[1, 2], [3]]>}
```

However this logic often requires slow shape comparisions and data copies, to avoid this you must explicitly use the [`Array`] feature type and specify the shape of your tensors:
However this logic often requires slow shape comparisons and data copies.
To avoid this, you must explicitly use the [`Array`] feature type and specify the shape of your tensors:

```py
>>> from datasets import Dataset, Features, Array2D
Expand Down

0 comments on commit 6548e0e

Please sign in to comment.