import torch


def lambda_x(x, c, keepdim=False):
  """Computes the conformal factor of x with curvature c."""
  c = torch.as_tensor(c).type_as(x)
  return 2 / (1 - c * x.pow(2).sum(-1, keepdim=keepdim))