3879bcde8d42c619c96b6483dba14a76a8e5f00b,gpytorch/utils/grid.py,,create_data_from_grid,#Any#,53

Before Change


    grid_dim = grid.size(-1)
    grid_data = torch.zeros(int(pow(grid_size, grid_dim)), grid_dim, device=grid.device)
    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:

After Change


            Returns the set of points on the grid going by column-major order
            (due to legacy reasons).
    
    if torch.is_tensor(grid):
        grid = convert_legacy_grid(grid)
    ndims = len(grid)
    assert all(axis.dim() == 1 for axis in grid)
    projections = torch.meshgrid(*grid)
    grid_tensor = torch.stack(projections, axis=-1)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: cornellius-gp/gpytorch
Commit Name: 3879bcde8d42c619c96b6483dba14a76a8e5f00b
Time: 2019-09-29
Author: kaw293@cornell.edu
File Name: gpytorch/utils/grid.py
Class Name:
Method Name: create_data_from_grid


Project Name: asyml/texar
Commit Name: 830108b4b5f71f1a63cbd97c8131ba1aef4ac56a
Time: 2018-06-02
Author: zhitinghu@gmail.com
File Name: texar/utils/shapes.py
Class Name:
Method Name: mask_sequences


Project Name: dmlc/dgl
Commit Name: cf8a3fb30547d6e980ecd8182f64a51df8e55c62
Time: 2021-02-10
Author: expye@outlook.com
File Name: python/dgl/backend/pytorch/tensor.py
Class Name:
Method Name: pack_padded_tensor