diff --git a/source/machine-learning/pytorch.md b/source/machine-learning/pytorch.md index 2c65971..98c4f67 100644 --- a/source/machine-learning/pytorch.md +++ b/source/machine-learning/pytorch.md @@ -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 +```