1e96334c79060b60c51c7d3b85bea7048d8e1ad2,test/kernels/test_grid_kernel.py,,,#,8

Before Change



grid_size = grid.size(-2)
grid_dim = grid.size(-1)
grid_data = torch.zeros(int(pow(grid_size, grid_dim)), grid_dim)
prev_points = None
for i in range(grid_dim):
    for j in range(grid_size):
        grid_data[j * grid_size ** i : (j + 1) * grid_size ** i, i].fill_(grid[j, i])
        if prev_points is not None:
            grid_data[j * grid_size ** i : (j + 1) * grid_size ** i, :i].copy_(prev_points)
    prev_points = grid_data[: grid_size ** (i + 1), : (i + 1)]


class TestGridKernel(unittest.TestCase):
    def test_grid_grid(self):

After Change


from gpytorch.utils.grid import create_data_from_grid


grid = [torch.linspace(0, 1, 5), torch.linspace(0, 2, 3)]
d = len(grid)
grid_data = create_data_from_grid(grid)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: cornellius-gp/gpytorch
Commit Name: 1e96334c79060b60c51c7d3b85bea7048d8e1ad2
Time: 2019-09-29
Author: kaw293@cornell.edu
File Name: test/kernels/test_grid_kernel.py
Class Name:
Method Name:


Project Name: bashtage/linearmodels
Commit Name: 3b7c9ec865c02888620cdf215e61c616e1dcc7a2
Time: 2021-01-06
Author: kevin.k.sheppard@gmail.com
File Name: linearmodels/tests/iv/test_model.py
Class Name:
Method Name: data


Project Name: CellProfiler/CellProfiler
Commit Name: e5f934c85ba8da496ba1a0b77c5c84dfc834f14f
Time: 2010-09-22
Author: afraser@1fc53939-2000-0410-845c-e8453a809027
File Name: imagej/tests/test_ijbridge.py
Class Name:
Method Name: