code: def test_norm_to_lognorm(self):
      for dtype in (torch.float, torch.double):
          # Test joint, independent
          expmu = torch.tensor(
              [1.0, 2.0, 3.0], device=self.device, dtype=dtype
          )
          expdiag = torch.tensor(
              [1.5, 2.0, 3], device=self.device, dtype=dtype
          )
          mu = torch.log(expmu)
          diag = torch.log(expdiag)
          Cov = torch.diag_embed(diag)
          mu_ln, Cov_ln = norm_to_lognorm(mu, Cov)
          mu_ln_expected = expmu * torch.exp(0.5 * diag)
          diag_ln_expected = torch.tensor(
              [0.75, 8.0, 54.0], device=self.device, dtype=dtype
          )
          Cov_ln_expected = torch.diag_embed(diag_ln_expected)
          self.assertAllClose(Cov_ln, Cov_ln_expected)
          self.assertAllClose(mu_ln, mu_ln_expected)
  
          # Test joint, correlated
          Cov[0, 2] = 0.1
          Cov[2, 0] = 0.1
          mu_ln, Cov_ln = norm_to_lognorm(mu, Cov)
          Cov_ln_expected[0, 2] = 0.669304
          Cov_ln_expected[2, 0] = 0.669304
          self.assertAllClose(Cov_ln, Cov_ln_expected)
          self.assertAllClose(mu_ln, mu_ln_expected)
  
          # Test marginal
          mu = torch.tensor(
              [-1.0, 0.0, 1.0], device=self.device, dtype=dtype
          )
          v = torch.tensor(
              [1.0, 2.0, 3.0], device=self.device, dtype=dtype
          )
          var = 2 * (torch.log(v) - mu)
          mu_ln = norm_to_lognorm_mean(mu, var)
          var_ln = norm_to_lognorm_variance(mu, var)
          mu_ln_expected = torch.tensor(
              [1.0, 2.0, 3.0], device=self.device, dtype=dtype
          )
          var_ln_expected = (torch.exp(var) - 1) * mu_ln_expected**2
          self.assertAllClose(mu_ln, mu_ln_expected)
          self.assertAllClose(var_ln, var_ln_expected)
  
file_path: botorch/test/models/transforms/test_utils.py
imports: import math
  from itertools import product
  import torch
  from botorch.models.transforms.utils import expand_and_copy_tensor, lognorm_to_norm, norm_to_lognorm, norm_to_lognorm_mean, norm_to_lognorm_variance
  from botorch.utils.testing import BotorchTestCase
label_desc: Use image node_id 2 for calling the TestTransformUtils obj's underlying member method code with example usage: obj.test_norm_to_lognorm() without return types