diff --git a/docs/source/named_tensor.rst b/docs/source/named_tensor.rst index cd8ac28466d..112682e7b26 100644 --- a/docs/source/named_tensor.rst +++ b/docs/source/named_tensor.rst @@ -204,9 +204,9 @@ and :meth:`~Tensor.reshape`, but have more semantic meaning to someone reading t >>> named_flat_imgs.names ('N', 'features') - >>> unflattened_imgs = imgs.view(32, 3, 128, 128) - >>> unflattened_named_imgs = named_flat_imgs.unflatten( - 'features', [('C', 3), ('H', 128), ('W', 128)]) + >>> unflattened_named_imgs = named_flat_imgs.unflatten('features', [('C', 3), ('H', 128), ('W', 128)]) + >>> unflattened_named_imgs.names + ('N', 'C', 'H', 'W') .. _named_tensors_autograd-doc: