From 5722b5cc5d30f81b3eef62ee064cd305f4b4c9f4 Mon Sep 17 00:00:00 2001 From: jloveric Date: Sun, 23 Jun 2024 14:08:47 -0700 Subject: [PATCH] Make grid float instead of int --- examples/block_mnist.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/block_mnist.py b/examples/block_mnist.py index 2ffd8f2..3b3b14a 100644 --- a/examples/block_mnist.py +++ b/examples/block_mnist.py @@ -33,10 +33,10 @@ } grid_x, grid_y = torch.meshgrid( - (torch.arange(28) - 14) // 14, (torch.arange(28) - 14) // 14, indexing="ij" + (torch.arange(28) - 14) / 14, (torch.arange(28) - 14) / 14, indexing="ij" ) grid = torch.stack([grid_x, grid_y]) - +print('grid', grid) def collate_fn(batch):