code: def guide(self, xs, ys=None):
      with pyro.plate("data"):
          if ys is None:
              # at inference time, ys is not provided. In that case,
              # the model uses the prior network
              y_hat = self.baseline_net(xs).view(xs.shape)
              loc, scale = self.prior_net(xs, y_hat)
          else:
              # at training time, uses the variational distribution
              # q(z|x,y) = normal(loc(x,y),scale(x,y))
              loc, scale = self.recognition_net(xs, ys)
  
          pyro.sample("z", dist.Normal(loc, scale).to_event(1))
  
imports: from pathlib import Path
  import numpy
  import torch
  import torch.nn
  from tqdm import tqdm
  import pyro
  import pyro.distributions
  from pyro.infer import SVI, Trace_ELBO
label_desc: Use image node_id 3 for calling the CVAE obj's underlying member method code with example usage: obj.guide(xs, ys) without return types