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.