def METHOD_NAME(x):
    mag = torch.linalg.norm(x, ord=pipeline.model.scene_contraction.order, dim=-1)
    mask = mag >= 1
    x_new = x.clone()
    x_new[mask] = (1 / (2 - mag[mask][..., None])) * (x[mask] / mag[mask][..., None])
    return x_new