code: def true_ape(ns):
      """Analytic APE"""
      true_ape = []
      prior_cov = torch.diag(prior_sds**2)
      designs = [
          group_assignment_matrix(torch.tensor([n1, N - n1]))
          for n1 in ns
      ]
      for i in range(len(ns)):
          x = designs[i]
          posterior_cov = analytic_posterior_cov(
              prior_cov, x, torch.tensor(1.0)
          )
          true_ape.append(
              0.5 * torch.logdet(2 * np.pi * np.e * posterior_cov)
          )
      return torch.tensor(true_ape)
  
file_path: pyro/examples/contrib/oed/ab_test.py
imports: import argparse
  from functools import partial
  import numpy
  import torch
  from gp_bayes_opt import GPBayesOptimizer
  from torch.distributions import constraints
  import pyro
  import pyro.contrib.gp
  from pyro import optim
  from pyro.contrib.oed.eig import vi_eig
  from pyro.contrib.oed.glmm import analytic_posterior_cov, group_assignment_matrix, zero_mean_unit_obs_sd_lm
  from pyro.infer import TraceEnum_ELBO
label_desc: Use image node_id 2 for calling a global function with example usage: true_ape(ns) and returns: torch