73a339fac0a9574ee16527ebf9b6d71073bb688b,torchgeometry/conversions.py,,convert_points_to_homogeneous,#Any#,101

Before Change


    if torch.is_tensor(points.shape[-1]):
        last_dim_shape = points.shape[-1].float()
        last_dim_bit_length = torch.floor(torch.log2(last_dim_shape)) + 1
        last_dim_bit_length = last_dim_bit_length.long()
    else:
        last_dim_bit_length = points.shape[-1].bit_length()

    // create shape for ones tensor: Nx(...)xD-1
    // new_shape = points.shape[:-1] + (int(points.shape[-1]).bit_length() - 1,)
    new_shape = points.shape[:-1] + (last_dim_bit_length - 1,)
    ones = torch.ones(new_shape, dtype=points.dtype)
    return torch.cat([points, ones.to(points.device)], dim=-1)


def transform_points(dst_pose_src, points_src):
    rFunction that applies transformations to a set of points.

After Change


        raise ValueError("Input must be at least a 2D tensor. Got {}".format(
            points.shape))

    return nn.functional.pad(points, (0, 1), "constant", 1.0)

def transform_points(dst_pose_src, points_src):
    rFunction that applies transformations to a set of points.
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 5

Instances


Project Name: arraiy/torchgeometry
Commit Name: 73a339fac0a9574ee16527ebf9b6d71073bb688b
Time: 2019-01-14
Author: kaplanonu@gmail.com
File Name: torchgeometry/conversions.py
Class Name:
Method Name: convert_points_to_homogeneous


Project Name: rusty1s/pytorch_geometric
Commit Name: 5980bd68fcd65ffe90fe560ff7db3f01e861426e
Time: 2017-11-02
Author: matthias.fey@tu-dortmund.de
File Name: torch_geometric/transform/graclus.py
Class Name:
Method Name: normalized_cut


Project Name: elbayadm/attn2d
Commit Name: 27568a7ebed1a35f08ac0390f35b3de9b8dad0dd
Time: 2019-11-13
Author: myleott@fb.com
File Name: fairseq/models/levenshtein_transformer.py
Class Name: LevenshteinTransformerDecoder
Method Name: extract_features