Skip to content

Commit ae7946a

Browse files
authored
Update log2.md
1 parent 01f1792 commit ae7946a

File tree

1 file changed

+3
-4
lines changed
  • content/pytorch/concepts/tensor-operations/terms/log2

1 file changed

+3
-4
lines changed

content/pytorch/concepts/tensor-operations/terms/log2/log2.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ Description: 'Computes the base-2 logarithm of each element in the input tensor
44
Subjects:
55
- 'Code Foundations'
66
- 'Computer Science'
7-
- 'Data Science'
87
Tags:
98
- 'Elements'
109
- 'Methods'
@@ -32,9 +31,9 @@ torch.log2(input, *, out=None) → Tensor
3231

3332
Returns a new tensor of the same shape as `input` where each element is `log₂(input[i])`.
3433

35-
## Example 1: Basic Usage of `torch.log2()`
34+
## Example 1: Basic Usage of `.log2()`
3635

37-
In this example, the base-2 logarithm is computed for a tensor of powers of two:
36+
In this example, the base-2 logarithm is computed for a tensor containing powers of 2:
3837

3938
```py
4039
import torch
@@ -54,7 +53,7 @@ The output of this code is:
5453
tensor([1., 2., 3., 4., 5.])
5554
```
5655

57-
## Example 2: Applying `torch.log2()` on Random Values
56+
## Example 2: Applying `.log2()` on Random Values
5857

5958
In this example, a tensor with random positive values is transformed using base-2 logarithm to analyze data on a log scale:
6059

0 commit comments

Comments
 (0)