Skip to content

Commit

Permalink
fixed some typos
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacperez committed Aug 19, 2024
1 parent 3c68254 commit 8117082
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/tensor.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Tensor
## Overview
The `Tensor` class in TinyGPT serves as the primary data structure for representing multi-dimensional arrays that can participate in automatic differentiation. `Tensor` encapsulates a Buffer for storing data, while also handling the computational graph required for backpropagation.
The `Tensor` class in TinyGPT serves as the primary data structure for representing multi-dimensional arrays that can participate in automatic differentiation. `Tensor` encapsulates a `Buffer` for storing data, while also handling the computational graph required for backpropagation.

Tensors are designed to be flexible and powerful, supporting various mathematical operations, broadcasting, and gradient tracking. These features enable the `Tensor` class to be seamlessly integrated into the training process of deep learning models.

Expand Down Expand Up @@ -112,7 +112,7 @@ c = a + b # Shape of c will be (3, 3)
You can also reshape, expand, and permute tensors to change their shape without altering the underlying data.

```python
tensor = Tensor.ones((2, 3), dtype=DType.float32)
tensor = Tensor.ones((2, 3, 1), dtype=DType.float32)

# Reshape the tensor
reshaped_tensor = tensor.reshape((3, 2))
Expand All @@ -121,7 +121,7 @@ reshaped_tensor = tensor.reshape((3, 2))
expanded_tensor = tensor.expand((2, 3, 4))

# Permute the dimensions
permuted_tensor = tensor.permute((1, 0))
permuted_tensor = tensor.permute((1, 0, 2))
```

## Serialization
Expand Down

0 comments on commit 8117082

Please sign in to comment.