Skip to content

Commit

Permalink
Update pytorch.md
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilipMay authored Sep 21, 2024
1 parent d707dac commit 1d587fb
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions source/machine-learning/pytorch.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,11 @@
- convert tensor to standard Python number
- only works for tensors with one element - otherwise an exception is raised
- implicitly moves the value to the CPU

## shape

Example:

```python
batch_size, sequence_length = attention_mask.shape
```

0 comments on commit 1d587fb

Please sign in to comment.