code: def aic_num_parameters(model, guide=None):
      """
      hacky AIC param count that includes all parameters in the model and guide
      """
  
      def _size(tensor):
          """product of shape"""
          s = 1
          for d in tensor.shape:
              s = s * d
          return s
  
      with poutine.block(), poutine.trace(
          param_only=True
      ) as param_capture:
          TraceEnum_ELBO(max_plate_nesting=2).differentiable_loss(
              model, guide
          )
  
      return sum(
          _size(node["value"])
          for node in param_capture.trace.nodes.values()
      )
  
file_path: pyro/examples/mixed_hmm/experiment.py
imports: import argparse
  import functools
  import json
  import os
  import uuid
  import torch
  from model import guide_generic, model_generic
  from seal_data import prepare_seal
  import pyro
  import pyro.poutine
  from pyro.infer import TraceEnum_ELBO
label_desc: Use image node_id 1 for calling a global function with example usage: aic_num_parameters(model, guide) and returns: sum, s