code: def test_log_mean_exp(self):
      for dtype in (torch.float32, torch.float64):
          X = torch.rand(3, 2, 5, dtype=dtype, device=self.device) + 0.1
  
          # test single-dimension reduction
          self.assertAllClose(
              logmeanexp(X.log(), dim=-1).exp(), X.mean(dim=-1)
          )
          self.assertAllClose(
              logmeanexp(X.log(), dim=-2).exp(), X.mean(dim=-2)
          )
          # test tuple of dimensions
          self.assertAllClose(
              logmeanexp(X.log(), dim=(0, -1)).exp(),
              X.mean(dim=(0, -1)),
          )
  
          # with keepdim
          self.assertAllClose(
              logmeanexp(X.log(), dim=-1, keepdim=True).exp(),
              X.mean(dim=-1, keepdim=True),
          )
          self.assertAllClose(
              logmeanexp(X.log(), dim=-2, keepdim=True).exp(),
              X.mean(dim=-2, keepdim=True),
          )
          self.assertAllClose(
              logmeanexp(X.log(), dim=(0, -1), keepdim=True).exp(),
              X.mean(dim=(0, -1), keepdim=True),
          )
  
imports: from __future__ import annotations
  import itertools
  import math
  from abc import abstractmethod
  from itertools import combinations, product
  from typing import Callable
  import torch
  from botorch.exceptions import UnsupportedError
  from botorch.utils import safe_math
  from botorch.utils.constants import get_constants_like
  from botorch.utils.objective import compute_smoothed_feasibility_indicator
  from botorch.utils.safe_math import _pareto, cauchy, fatmax, fatmaximum, fatminimum, fatmoid, fatplus, log_fatmoid, log_fatplus, log_softplus, logdiffexp, logexpit, logmeanexp, logplusexp, sigmoid, smooth_amax
  from botorch.utils.testing import BotorchTestCase
  from torch import finfo, Tensor
  from torch.nn.functional import softplus
label_desc: Use image node_id 1 for calling the TestLogMeanExp obj's underlying member method code with example usage: obj.test_log_mean_exp() without return types