code: def random_mvn(batch_shape, dim, requires_grad=False):
      rank = dim + dim
      loc = torch.randn(
          batch_shape + (dim,), requires_grad=requires_grad
      )
      cov = torch.randn(batch_shape + (dim, rank))
      cov = cov.matmul(cov.transpose(-1, -2))
      scale_tril = torch.linalg.cholesky(cov)
      scale_tril.requires_grad_(requires_grad)
      return dist.MultivariateNormal(loc, scale_tril=scale_tril)
  
imports: import argparse
  import torch
  from tqdm.auto import tqdm
  import pyro.distributions
label_desc: Use image node_id 1 for calling a global function with example usage: random_mvn(batch_shape, dim, requires_grad) and returns: dist