From c1949343ad016067f12e0de368c85e1245adf658 Mon Sep 17 00:00:00 2001 From: pytorchbot Date: Thu, 28 Nov 2024 11:34:52 +0000 Subject: [PATCH] 2024-11-28 nightly release (19fef3d3bff17bdcf89721f0af16a9b8acf75693) --- .gitignore | 3 +++ references/depth/stereo/utils/losses.py | 2 +- references/video_classification/train.py | 4 ++-- torchvision/datasets/lsun.py | 2 +- torchvision/models/googlenet.py | 2 +- torchvision/models/maxvit.py | 2 +- 6 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index f16b54061e0..c2d4d2a1c42 100644 --- a/.gitignore +++ b/.gitignore @@ -16,6 +16,7 @@ docs/source/auto_examples/ docs/source/gen_modules/ docs/source/generated/ docs/source/models/generated/ +docs/source/sg_execution_times.rst # pytorch-sphinx-theme gets installed here docs/src @@ -42,3 +43,5 @@ xcuserdata/ # direnv .direnv .envrc + +scripts/release_notes/data.json diff --git a/references/depth/stereo/utils/losses.py b/references/depth/stereo/utils/losses.py index c809cc74d0f..1c21353a056 100644 --- a/references/depth/stereo/utils/losses.py +++ b/references/depth/stereo/utils/losses.py @@ -13,7 +13,7 @@ def make_gaussian_kernel(kernel_size: int, sigma: float) -> torch.Tensor: y = torch.arange(kernel_size, dtype=torch.float32) x = x - (kernel_size - 1) / 2 y = y - (kernel_size - 1) / 2 - x, y = torch.meshgrid(x, y) + x, y = torch.meshgrid(x, y, indexing="ij") grid = (x**2 + y**2) / (2 * sigma**2) kernel = torch.exp(-grid) kernel = kernel / kernel.sum() diff --git a/references/video_classification/train.py b/references/video_classification/train.py index 945c8c67c76..a03a9722003 100644 --- a/references/video_classification/train.py +++ b/references/video_classification/train.py @@ -164,7 +164,7 @@ def main(args): if args.cache_dataset and os.path.exists(cache_path): print(f"Loading dataset_train from {cache_path}") - dataset, _ = torch.load(cache_path, weights_only=True) + dataset, _ = torch.load(cache_path, weights_only=False) dataset.transform = transform_train else: if args.distributed: @@ -201,7 +201,7 @@ def main(args): if args.cache_dataset and os.path.exists(cache_path): print(f"Loading dataset_test from {cache_path}") - dataset_test, _ = torch.load(cache_path, weights_only=True) + dataset_test, _ = torch.load(cache_path, weights_only=False) dataset_test.transform = transform_test else: if args.distributed: diff --git a/torchvision/datasets/lsun.py b/torchvision/datasets/lsun.py index a2f5e18b991..61d40eee221 100644 --- a/torchvision/datasets/lsun.py +++ b/torchvision/datasets/lsun.py @@ -55,7 +55,7 @@ def __len__(self) -> int: class LSUN(VisionDataset): - """`LSUN `_ dataset. + """`LSUN `_ dataset. You will need to install the ``lmdb`` package to use this dataset: run ``pip install lmdb`` diff --git a/torchvision/models/googlenet.py b/torchvision/models/googlenet.py index 1dc5136d726..1d8ecbcd3b2 100644 --- a/torchvision/models/googlenet.py +++ b/torchvision/models/googlenet.py @@ -171,7 +171,7 @@ def eager_outputs(self, x: Tensor, aux2: Tensor, aux1: Optional[Tensor]) -> Goog def forward(self, x: Tensor) -> GoogLeNetOutputs: x = self._transform_input(x) - x, aux1, aux2 = self._forward(x) + x, aux2, aux1 = self._forward(x) aux_defined = self.training and self.aux_logits if torch.jit.is_scripting(): if not aux_defined: diff --git a/torchvision/models/maxvit.py b/torchvision/models/maxvit.py index 2a3888b2af3..66f49772218 100644 --- a/torchvision/models/maxvit.py +++ b/torchvision/models/maxvit.py @@ -40,7 +40,7 @@ def _make_block_input_shapes(input_size: Tuple[int, int], n_blocks: int) -> List def _get_relative_position_index(height: int, width: int) -> torch.Tensor: - coords = torch.stack(torch.meshgrid([torch.arange(height), torch.arange(width)])) + coords = torch.stack(torch.meshgrid([torch.arange(height), torch.arange(width)], indexing="ij")) coords_flat = torch.flatten(coords, 1) relative_coords = coords_flat[:, :, None] - coords_flat[:, None, :] relative_coords = relative_coords.permute(1, 2, 0).contiguous()