def inverse_gamma_shape_scale_from_mean_stddev(mean, stddev):
  """Compute inverse Gamma shape and scale from mean and standard deviation.

  Args:
    mean: Tensor, scalar, >0.0, the mean of the Inverse Gamma variate.
    stddev: Tensor, scalar, >0.0, the standard deviation of the Inverse Gamma
      variate.

  Returns:
    ig_shape: Tensor, scalar, >0.0, the inverse Gamma shape parameter.
    ig_scale: Tensor, scalar, >0.0, the inverse Gamma scale parameter.
  """
  cvar = (mean / stddev)**2.0
  ig_shape = cvar + 2.0
  ig_scale = mean*(cvar + 1.0)

  return ig_shape, ig_scale