Skip to content

Commit

Permalink
modify documents for tensor api
Browse files Browse the repository at this point in the history
  • Loading branch information
tiruka committed Dec 26, 2024
1 parent 1909afd commit ac060d1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions burn-book/src/building-blocks/tensor.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ Those operations are available for all tensor kinds: `Int`, `Float`, and `Bool`.
| `tensor.narrow(dim, start, length)` | `tensor.narrow(dim, start, length)` |
| `tensor.not_equal(other)` | `x != y` |
| `tensor.permute(axes)` | `tensor.permute(axes)` |
| `tensor.one_hot_plus(depth, on_value, off_value, axis)` | N/A |
| `tensor.one_hot_fill(depth, on_value, off_value, axis)` | N/A |
| `tensor.movedim(src, dst)` | `tensor.movedim(src, dst)` |
| `tensor.repeat_dim(dim, times)` | `tensor.repeat(*[times if i == dim else 1 for i in range(tensor.dim())])` |
| `tensor.repeat(sizes)` | `tensor.repeat(sizes)` |
Expand Down Expand Up @@ -259,7 +259,7 @@ Those operations are only available for `Float` tensors.

| Burn API | PyTorch Equivalent |
| --------------------------------------------- | ---------------------------------- |
| `Tensor::one_hot(index, num_classes, device)` | N/A |
| `tensor.one_hot(num_classes)` | `torch.nn.functional.one_hot` |
| `tensor.cast(dtype)` | `tensor.to(dtype)` |
| `tensor.ceil()` | `tensor.ceil()` |
| `tensor.cos()` | `tensor.cos()` |
Expand Down Expand Up @@ -297,7 +297,7 @@ Those operations are only available for `Int` tensors.
| `tensor.from_ints(ints)` | N/A |
| `tensor.int_random(shape, distribution, device)` | N/A |
| `tensor.cartesian_grid(shape, device)` | N/A |
| `tensor.one_hot(num_classes)` | N/A |
| `tensor.one_hot(num_classes)` | `torch.nn.functional.one_hot` |

### Bool Operations

Expand Down

0 comments on commit ac060d1

Please sign in to comment.