Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def _recompute_value_from_cov(cov_path: str, stat: str, thresh: float) -> float:
cov = torch.from_numpy(np.load(cov_path))
if stat == 'lsat':
return compute_saturation(cov, thresh)
elif stat == 'idim':
return compute_intrinsic_dimensionality(cov, thresh)